summaryrefslogtreecommitdiff
path: root/platform/javascript
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2021-03-25 16:56:12 -0400
committerAaron Franke <arnfranke@yahoo.com>2021-06-20 11:54:24 -0400
commit0ce49800acf464c2242c3f7e021b4ab8f49ec366 (patch)
treeba1b10099dfbaf9798a16f619493a49a37701dbc /platform/javascript
parente919d894f84ea86ee43a3e1b8a675b9fec28f01c (diff)
Use mouse and joypad enums instead of plain integers
Also MIDIMessage
Diffstat (limited to 'platform/javascript')
-rw-r--r--platform/javascript/display_server_javascript.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/platform/javascript/display_server_javascript.cpp b/platform/javascript/display_server_javascript.cpp
index 8831d26190..f1b92264e2 100644
--- a/platform/javascript/display_server_javascript.cpp
+++ b/platform/javascript/display_server_javascript.cpp
@@ -229,8 +229,8 @@ EM_BOOL DisplayServerJavaScript::mouse_button_callback(int p_event_type, const E
}
Input *input = Input::get_singleton();
- int mask = input->get_mouse_button_mask();
- int button_flag = 1 << (ev->get_button_index() - 1);
+ MouseButton mask = input->get_mouse_button_mask();
+ MouseButton button_flag = MouseButton(1 << (ev->get_button_index() - 1));
if (ev->is_pressed()) {
// Since the event is consumed, focus manually. The containing iframe,
// if exists, may not have focus yet, so focus even if already focused.
@@ -478,11 +478,11 @@ EM_BOOL DisplayServerJavaScript::wheel_callback(int p_event_type, const Emscript
int button_flag = 1 << (ev->get_button_index() - 1);
ev->set_pressed(true);
- ev->set_button_mask(input->get_mouse_button_mask() | button_flag);
+ ev->set_button_mask(MouseButton(input->get_mouse_button_mask() | button_flag));
input->parse_input_event(ev);
ev->set_pressed(false);
- ev->set_button_mask(input->get_mouse_button_mask() & ~button_flag);
+ ev->set_button_mask(MouseButton(input->get_mouse_button_mask() & ~button_flag));
input->parse_input_event(ev);
return true;