diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-09-08 09:24:24 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-09-08 09:24:24 +0200 |
commit | 69233093d7e6479b5130bf2c39cbf464a6809c1b (patch) | |
tree | 8aae4dde5aaa7f0104afd2bb5b9eac317d780d68 /core/os/keyboard.h | |
parent | 7936b3cc4c657e4b273b376068f095e1e0e4d82a (diff) | |
parent | 6f4d233062d44bd46b2f03596e72f0bc9709d2b5 (diff) |
Merge pull request #65241 from bruvzg/no_keymap_ambiguity
Fix key mapping changes when moving from macOS to other platform.
Diffstat (limited to 'core/os/keyboard.h')
-rw-r--r-- | core/os/keyboard.h | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/core/os/keyboard.h b/core/os/keyboard.h index 29418049cb..e5d9b24e85 100644 --- a/core/os/keyboard.h +++ b/core/os/keyboard.h @@ -36,11 +36,11 @@ enum class Key { NONE = 0, // Special key: The strategy here is similar to the one used by toolkits, - // which consists in leaving the 24 bits unicode range for printable - // characters, and use the upper 8 bits for special keys and modifiers. + // which consists in leaving the 21 bits unicode range for printable + // characters, and use the upper 11 bits for special keys and modifiers. // This way everything (char/keycode) can fit nicely in one 32-bit // integer (the enum's underlying type is `int` by default). - SPECIAL = (1 << 24), + SPECIAL = (1 << 22), /* CURSOR/FUNCTION/BROWSER/MULTIMEDIA/MISC KEYS */ ESCAPE = SPECIAL | 0x01, TAB = SPECIAL | 0x02, @@ -312,17 +312,14 @@ enum class Key { }; enum class KeyModifierMask { - CODE_MASK = ((1 << 25) - 1), ///< Apply this mask to any keycode to remove modifiers. - MODIFIER_MASK = (0x7F << 24), ///< Apply this mask to isolate modifiers. + CODE_MASK = ((1 << 23) - 1), ///< Apply this mask to any keycode to remove modifiers. + MODIFIER_MASK = (0x7F << 22), ///< Apply this mask to isolate modifiers. + //RESERVED = (1 << 23), + CMD_OR_CTRL = (1 << 24), SHIFT = (1 << 25), ALT = (1 << 26), META = (1 << 27), CTRL = (1 << 28), -#ifdef APPLE_STYLE_KEYS - CMD = META, -#else - CMD = CTRL, -#endif KPAD = (1 << 29), GROUP_SWITCH = (1 << 30) }; |