summaryrefslogtreecommitdiffstats
path: root/platform/javascript/godot_js.h
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2021-09-10 21:46:22 +0200
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2021-10-05 14:15:07 +0200
commitb2d30c725df3cb04f8a5b93455da13f5945d8b4d (patch)
treedcf7c205548864913406afd43dc67c5abe158640 /platform/javascript/godot_js.h
parentb1c6826b9f84ad564c41a6d1b1e76b09354b8945 (diff)
downloadredot-engine-b2d30c725df3cb04f8a5b93455da13f5945d8b4d.tar.gz
[HTML5] Implement mouse/touch/key events in JS library.
This makes us more independent from emscripten libraries, giving us more control on the application lifecycle.
Diffstat (limited to 'platform/javascript/godot_js.h')
-rw-r--r--platform/javascript/godot_js.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/platform/javascript/godot_js.h b/platform/javascript/godot_js.h
index d332af2c31..512349180f 100644
--- a/platform/javascript/godot_js.h
+++ b/platform/javascript/godot_js.h
@@ -68,7 +68,6 @@ extern void godot_js_display_window_size_get(int32_t *p_x, int32_t *p_y);
extern void godot_js_display_screen_size_get(int32_t *p_x, int32_t *p_y);
extern int godot_js_display_fullscreen_request();
extern int godot_js_display_fullscreen_exit();
-extern void godot_js_display_compute_position(int p_x, int p_y, int32_t *r_x, int32_t *r_y);
extern void godot_js_display_window_title_set(const char *p_text);
extern void godot_js_display_window_icon_set(const uint8_t *p_ptr, int p_len);
extern int godot_js_display_has_webgl(int p_version);
@@ -90,6 +89,11 @@ extern int godot_js_display_gamepad_sample_count();
extern int godot_js_display_gamepad_sample_get(int p_idx, float r_btns[16], int32_t *r_btns_num, float r_axes[10], int32_t *r_axes_num, int32_t *r_standard);
// Display listeners
+extern void godot_js_display_mouse_button_cb(int (*p_callback)(int p_pressed, int p_button, double p_x, double p_y, int p_modifiers));
+extern void godot_js_display_mouse_move_cb(void (*p_callback)(double p_x, double p_y, double p_rel_x, double p_rel_y, int p_modifiers));
+extern void godot_js_display_mouse_wheel_cb(int (*p_callback)(double p_delta_x, double p_delta_y));
+extern void godot_js_display_touch_cb(void (*p_callback)(int p_type, int p_count), uint32_t *r_identifiers, double *r_coords);
+extern void godot_js_display_key_cb(void (*p_callback)(int p_type, int p_repeat, int p_modifiers), char r_code[32], char r_key[32]);
extern void godot_js_display_notification_cb(void (*p_callback)(int p_notification), int p_enter, int p_exit, int p_in, int p_out);
extern void godot_js_display_paste_cb(void (*p_callback)(const char *p_text));
extern void godot_js_display_drop_files_cb(void (*p_callback)(char **p_filev, int p_filec));