diff options
author | Nathan Letwory <nathan@letworyinteractive.com> | 2010-09-16 10:52:12 +0400 |
---|---|---|
committer | Nathan Letwory <nathan@letworyinteractive.com> | 2010-09-16 10:52:12 +0400 |
commit | 6b18c9dc61d79c453f0a6754209ae3f460810a2c (patch) | |
tree | 01b6fde47867d15ff87c8a8982361f79749fe71c /intern | |
parent | 4a840db7e9987c3b8f09c0f1fbc7abd7e1a12e38 (diff) |
Partial fix (Linux) [#21395] Command key for keyboard mapping not functional
Reported by Andy Braham
Handle XK_Super_L and XK_Super_R as the GHOST_kKeyCommand. Since Command key is
not discerned (yet) in left/right variants, read both and set accordingly.
This now completes fixes for [#21395]
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemX11.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp index 961a637e616..b07dba7319f 100644 --- a/intern/ghost/intern/GHOST_SystemX11.cpp +++ b/intern/ghost/intern/GHOST_SystemX11.cpp @@ -851,6 +851,8 @@ getModifierKeys( const KeyCode control_r = XKeysymToKeycode(m_display,XK_Control_R); const KeyCode alt_l = XKeysymToKeycode(m_display,XK_Alt_L); const KeyCode alt_r = XKeysymToKeycode(m_display,XK_Alt_R); + const KeyCode super_l = XKeysymToKeycode(m_display,XK_Super_L); + const KeyCode super_r = XKeysymToKeycode(m_display,XK_Super_R); // Shift if ((m_keyboard_vector[shift_l >> 3] >> (shift_l & 7)) & 1) { @@ -888,6 +890,15 @@ getModifierKeys( } else { keys.set(GHOST_kModifierKeyRightAlt,false); } + + // Super (Windows) - only one GHOST-kModifierKeyCommand, so mapping + // to either + if ( ((m_keyboard_vector[super_l >> 3] >> (super_l & 7)) & 1) || + ((m_keyboard_vector[super_r >> 3] >> (super_r & 7)) & 1) ) { + keys.set(GHOST_kModifierKeyCommand,true); + } else { + keys.set(GHOST_kModifierKeyCommand,false); + } return GHOST_kSuccess; } @@ -1095,6 +1106,8 @@ convertXKey( GXMAP(type,XK_Control_R, GHOST_kKeyRightControl); GXMAP(type,XK_Alt_L, GHOST_kKeyLeftAlt); GXMAP(type,XK_Alt_R, GHOST_kKeyRightAlt); + GXMAP(type,XK_Super_L, GHOST_kKeyCommand); + GXMAP(type,XK_Super_R, GHOST_kKeyCommand); GXMAP(type,XK_Insert, GHOST_kKeyInsert); GXMAP(type,XK_Delete, GHOST_kKeyDelete); |