diff options
author | Aaron Franke <arnfranke@yahoo.com> | 2021-06-20 13:12:33 -0400 |
---|---|---|
committer | Aaron Franke <arnfranke@yahoo.com> | 2021-08-10 16:26:55 -0500 |
commit | fa3a32a2d6b054543645b0d4752514c90732b935 (patch) | |
tree | f3ba2c2543431c356ba0eca13d5be9a3e42daedd /platform/windows | |
parent | 18bd0fee5a8aa360177cbe14a16d6be69f088d8f (diff) |
Use Key enum instead of plain integers
Diffstat (limited to 'platform/windows')
-rw-r--r-- | platform/windows/display_server_windows.cpp | 8 | ||||
-rw-r--r-- | platform/windows/key_mapping_windows.cpp | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/platform/windows/display_server_windows.cpp b/platform/windows/display_server_windows.cpp index 4be95487b8..42a517879b 100644 --- a/platform/windows/display_server_windows.cpp +++ b/platform/windows/display_server_windows.cpp @@ -2855,8 +2855,8 @@ void DisplayServerWindows::_process_key_events() { k->set_ctrl_pressed(ke.control); k->set_meta_pressed(ke.meta); k->set_pressed(true); - k->set_keycode(KeyMappingWindows::get_keysym(ke.wParam)); - k->set_physical_keycode(KeyMappingWindows::get_scansym((ke.lParam >> 16) & 0xFF, ke.lParam & (1 << 24))); + k->set_keycode((Key)KeyMappingWindows::get_keysym(ke.wParam)); + k->set_physical_keycode((Key)(KeyMappingWindows::get_scansym((ke.lParam >> 16) & 0xFF, ke.lParam & (1 << 24)))); k->set_unicode(unicode); if (k->get_unicode() && gr_mem) { k->set_alt_pressed(false); @@ -2888,10 +2888,10 @@ void DisplayServerWindows::_process_key_events() { // Special case for Numpad Enter key k->set_keycode(KEY_KP_ENTER); } else { - k->set_keycode(KeyMappingWindows::get_keysym(ke.wParam)); + k->set_keycode((Key)KeyMappingWindows::get_keysym(ke.wParam)); } - k->set_physical_keycode(KeyMappingWindows::get_scansym((ke.lParam >> 16) & 0xFF, ke.lParam & (1 << 24))); + k->set_physical_keycode((Key)(KeyMappingWindows::get_scansym((ke.lParam >> 16) & 0xFF, ke.lParam & (1 << 24)))); if (i + 1 < key_event_pos && key_event_buffer[i + 1].uMsg == WM_CHAR) { char32_t unicode = key_event_buffer[i + 1].wParam; diff --git a/platform/windows/key_mapping_windows.cpp b/platform/windows/key_mapping_windows.cpp index c367c69826..db99d6c122 100644 --- a/platform/windows/key_mapping_windows.cpp +++ b/platform/windows/key_mapping_windows.cpp @@ -365,6 +365,8 @@ unsigned int KeyMappingWindows::get_scansym(unsigned int p_code, bool p_extended case KEY_CAPSLOCK: { keycode = KEY_KP_ADD; } break; + default: + break; } } else { switch (keycode) { @@ -404,6 +406,8 @@ unsigned int KeyMappingWindows::get_scansym(unsigned int p_code, bool p_extended case KEY_PRINT: { keycode = KEY_KP_MULTIPLY; } break; + default: + break; } } |