diff options
| author | Rémi Verschelde <remi@verschelde.fr> | 2021-08-11 11:20:45 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-11 11:20:45 +0200 |
| commit | c00303ff55f2a67d5cb1a031070e3b1fe7b15a9e (patch) | |
| tree | 41c169c558961c715283d70822a703bd0a7c0706 /platform/linuxbsd/key_mapping_x11.cpp | |
| parent | a902f760634432adcb5f74b3b6cd27a7275a320f (diff) | |
| parent | fa3a32a2d6b054543645b0d4752514c90732b935 (diff) | |
Merge pull request #47378 from aaronfranke/use-input-enums
Use key enum instead of plain integers for input code
Diffstat (limited to 'platform/linuxbsd/key_mapping_x11.cpp')
| -rw-r--r-- | platform/linuxbsd/key_mapping_x11.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/platform/linuxbsd/key_mapping_x11.cpp b/platform/linuxbsd/key_mapping_x11.cpp index 74257a7e61..a1ef28234d 100644 --- a/platform/linuxbsd/key_mapping_x11.cpp +++ b/platform/linuxbsd/key_mapping_x11.cpp @@ -34,7 +34,7 @@ struct _XTranslatePair { KeySym keysym; - unsigned int keycode; + Key keycode; }; static _XTranslatePair _xkeysym_to_keycode[] = { @@ -176,7 +176,7 @@ static _XTranslatePair _xkeysym_to_keycode[] = { { XF86XK_LaunchC, KEY_LAUNCHE }, { XF86XK_LaunchD, KEY_LAUNCHF }, - { 0, 0 } + { 0, KEY_NONE } }; struct _TranslatePair { @@ -309,11 +309,11 @@ unsigned int KeyMappingX11::get_scancode(unsigned int p_code) { return keycode; } -unsigned int KeyMappingX11::get_keycode(KeySym p_keysym) { +Key KeyMappingX11::get_keycode(KeySym p_keysym) { // kinda bruteforce.. could optimize. if (p_keysym < 0x100) { // Latin 1, maps 1-1 - return p_keysym; + return (Key)p_keysym; } // look for special key @@ -323,14 +323,14 @@ unsigned int KeyMappingX11::get_keycode(KeySym p_keysym) { } } - return 0; + return KEY_NONE; } -KeySym KeyMappingX11::get_keysym(unsigned int p_code) { +KeySym KeyMappingX11::get_keysym(Key p_code) { // kinda bruteforce.. could optimize. if (p_code < 0x100) { // Latin 1, maps 1-1 - return p_code; + return (KeySym)p_code; } // look for special key @@ -340,7 +340,7 @@ KeySym KeyMappingX11::get_keysym(unsigned int p_code) { } } - return 0; + return (KeySym)KEY_NONE; } /***** UNICODE CONVERSION ******/ |