diff options
author | mathias <mathias> | 2005-05-06 09:22:53 (GMT) |
---|---|---|
committer | mathias <mathias> | 2005-05-06 09:22:53 (GMT) |
commit | 6c057c6903151aab92309310087d5af455ecefce (patch) | |
tree | 1d4c98ad1637df09b89593b3e6a4a70245db4602 /src/FbTk/KeyUtil.hh | |
parent | 7d4f711204ab0b51d45eaff332708f529c11c9f5 (diff) | |
download | fluxbox-6c057c6903151aab92309310087d5af455ecefce.zip fluxbox-6c057c6903151aab92309310087d5af455ecefce.tar.bz2 |
Fix for #1160244, #1099704, #1094107:
if the xkb-extension is enabled and the user switches between his/her
keyboardlayouts fluxbox's keybhandling doesn't work well anymore because
xkeyevent.state contains also xkb-related flags and thus we have to handle
that with caution.
KeyUtils now contain 'isolateModifierMask()' to really work only on the
modifiers. why not as part of cleanMods() ? because the XLookupString return
false results, eg TextBox's would only print chars from the first
keyboardlayout.
Diffstat (limited to 'src/FbTk/KeyUtil.hh')
-rw-r--r-- | src/FbTk/KeyUtil.hh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/FbTk/KeyUtil.hh b/src/FbTk/KeyUtil.hh index 4cafcdd..e32384f 100644 --- a/src/FbTk/KeyUtil.hh +++ b/src/FbTk/KeyUtil.hh | |||
@@ -70,6 +70,14 @@ public: | |||
70 | return mods & ~(capslock() | numlock() ); | 70 | return mods & ~(capslock() | numlock() ); |
71 | } | 71 | } |
72 | 72 | ||
73 | /** | ||
74 | strip away everything which is actually not a modifier | ||
75 | eg, xkb-keyboardgroups are encoded as bit 13 and 14 | ||
76 | */ | ||
77 | unsigned int isolateModifierMask(unsigned int mods) { | ||
78 | return mods & (ShiftMask|LockMask|ControlMask|Mod1Mask|Mod2Mask|Mod3Mask|Mod4Mask|Mod5Mask); | ||
79 | } | ||
80 | |||
73 | /** | 81 | /** |
74 | Convert the specified key into appropriate modifier mask | 82 | Convert the specified key into appropriate modifier mask |
75 | @return corresponding modifier mask | 83 | @return corresponding modifier mask |
@@ -78,6 +86,7 @@ public: | |||
78 | int numlock() const { return Mod2Mask; } //m_numlock; } | 86 | int numlock() const { return Mod2Mask; } //m_numlock; } |
79 | int capslock() const { return LockMask; } //m_capslock; } | 87 | int capslock() const { return LockMask; } //m_capslock; } |
80 | int scrolllock() const { return Mod5Mask; } //m_scrolllock; } | 88 | int scrolllock() const { return Mod5Mask; } //m_scrolllock; } |
89 | |||
81 | private: | 90 | private: |
82 | void loadModmap(); | 91 | void loadModmap(); |
83 | 92 | ||