Rename ButtonList enum and members to MouseButton

This commit is contained in:
Aaron Franke 2021-01-07 22:37:37 -05:00
parent 70eff30c5f
commit 10d7fccb54
No known key found for this signature in database
GPG key ID: 40A1750B977E56BF
75 changed files with 468 additions and 473 deletions

View file

@ -189,19 +189,19 @@ EM_BOOL DisplayServerJavaScript::mouse_button_callback(int p_event_type, const E
switch (p_event->button) {
case DOM_BUTTON_LEFT:
ev->set_button_index(BUTTON_LEFT);
ev->set_button_index(MOUSE_BUTTON_LEFT);
break;
case DOM_BUTTON_MIDDLE:
ev->set_button_index(BUTTON_MIDDLE);
ev->set_button_index(MOUSE_BUTTON_MIDDLE);
break;
case DOM_BUTTON_RIGHT:
ev->set_button_index(BUTTON_RIGHT);
ev->set_button_index(MOUSE_BUTTON_RIGHT);
break;
case DOM_BUTTON_XBUTTON1:
ev->set_button_index(BUTTON_XBUTTON1);
ev->set_button_index(MOUSE_BUTTON_XBUTTON1);
break;
case DOM_BUTTON_XBUTTON2:
ev->set_button_index(BUTTON_XBUTTON2);
ev->set_button_index(MOUSE_BUTTON_XBUTTON2);
break;
default:
return false;
@ -461,13 +461,13 @@ EM_BOOL DisplayServerJavaScript::wheel_callback(int p_event_type, const Emscript
ev->set_metakey(input->is_key_pressed(KEY_META));
if (p_event->deltaY < 0)
ev->set_button_index(BUTTON_WHEEL_UP);
ev->set_button_index(MOUSE_BUTTON_WHEEL_UP);
else if (p_event->deltaY > 0)
ev->set_button_index(BUTTON_WHEEL_DOWN);
ev->set_button_index(MOUSE_BUTTON_WHEEL_DOWN);
else if (p_event->deltaX > 0)
ev->set_button_index(BUTTON_WHEEL_LEFT);
ev->set_button_index(MOUSE_BUTTON_WHEEL_LEFT);
else if (p_event->deltaX < 0)
ev->set_button_index(BUTTON_WHEEL_RIGHT);
ev->set_button_index(MOUSE_BUTTON_WHEEL_RIGHT);
else
return false;