diff options
author | Campbell Barton <campbell@blender.org> | 2022-09-18 03:31:14 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-09-18 03:31:14 +0300 |
commit | 0950e6fae6800cd847d1c74e35489e46b0c48229 (patch) | |
tree | 5aa7e69b072c80c953b8edd7011ec65241694454 /intern/ghost/intern/GHOST_SystemSDL.cpp | |
parent | 8934f00ac5701ea349f2bcccab32e252c79aa730 (diff) |
GHOST: support left/right OS-key
Handling the OS key now match other modifiers in GHOST which detect
each key separately, making the behavior simpler to reason about since
mapping a single key to a modifier state is simpler, avoiding handling
that only applied to the OS-Key.
This means simulating key up/down events can use the correct modifier.
In the window-manager this is still only accessed accessed via KM_OSKEY.
Diffstat (limited to 'intern/ghost/intern/GHOST_SystemSDL.cpp')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemSDL.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/intern/ghost/intern/GHOST_SystemSDL.cpp b/intern/ghost/intern/GHOST_SystemSDL.cpp index 6d0b2b8aa55..76770e735fa 100644 --- a/intern/ghost/intern/GHOST_SystemSDL.cpp +++ b/intern/ghost/intern/GHOST_SystemSDL.cpp @@ -161,7 +161,8 @@ GHOST_TSuccess GHOST_SystemSDL::getModifierKeys(GHOST_ModifierKeys &keys) const keys.set(GHOST_kModifierKeyRightControl, (mod & KMOD_RCTRL) != 0); keys.set(GHOST_kModifierKeyLeftAlt, (mod & KMOD_LALT) != 0); keys.set(GHOST_kModifierKeyRightAlt, (mod & KMOD_RALT) != 0); - keys.set(GHOST_kModifierKeyOS, (mod & (KMOD_LGUI | KMOD_RGUI)) != 0); + keys.set(GHOST_kModifierKeyLeftOS, (mod & KMOD_LGUI) != 0); + keys.set(GHOST_kModifierKeyRightOS, (mod & KMOD_RGUI) != 0); return GHOST_kSuccess; } @@ -219,8 +220,8 @@ static GHOST_TKey convertSDLKey(SDL_Scancode key) GXMAP(type, SDL_SCANCODE_RCTRL, GHOST_kKeyRightControl); GXMAP(type, SDL_SCANCODE_LALT, GHOST_kKeyLeftAlt); GXMAP(type, SDL_SCANCODE_RALT, GHOST_kKeyRightAlt); - GXMAP(type, SDL_SCANCODE_LGUI, GHOST_kKeyOS); - GXMAP(type, SDL_SCANCODE_RGUI, GHOST_kKeyOS); + GXMAP(type, SDL_SCANCODE_LGUI, GHOST_kKeyLeftOS); + GXMAP(type, SDL_SCANCODE_RGUI, GHOST_kKeyRightOS); GXMAP(type, SDL_SCANCODE_APPLICATION, GHOST_kKeyApp); GXMAP(type, SDL_SCANCODE_INSERT, GHOST_kKeyInsert); |