aboutsummaryrefslogtreecommitdiff
path: root/src/Keys.hh
diff options
context:
space:
mode:
authormathias <mathias>2005-05-06 09:22:53 (GMT)
committermathias <mathias>2005-05-06 09:22:53 (GMT)
commit6c057c6903151aab92309310087d5af455ecefce (patch)
tree1d4c98ad1637df09b89593b3e6a4a70245db4602 /src/Keys.hh
parent7d4f711204ab0b51d45eaff332708f529c11c9f5 (diff)
downloadfluxbox-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/Keys.hh')
-rw-r--r--src/Keys.hh8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Keys.hh b/src/Keys.hh
index c9c53b5..f83f6e8 100644
--- a/src/Keys.hh
+++ b/src/Keys.hh
@@ -31,6 +31,7 @@
31#include "FbTk/NotCopyable.hh" 31#include "FbTk/NotCopyable.hh"
32#include "FbTk/RefCount.hh" 32#include "FbTk/RefCount.hh"
33#include "FbTk/Command.hh" 33#include "FbTk/Command.hh"
34#include "FbTk/KeyUtil.hh"
34 35
35class Keys:private FbTk::NotCopyable { 36class Keys:private FbTk::NotCopyable {
36public: 37public:
@@ -86,21 +87,22 @@ private:
86 87
87 inline t_key *find(unsigned int key_, unsigned int mod_) { 88 inline t_key *find(unsigned int key_, unsigned int mod_) {
88 for (unsigned int i=0; i<keylist.size(); i++) { 89 for (unsigned int i=0; i<keylist.size(); i++) {
89 if (keylist[i]->key == key_ && keylist[i]->mod == mod_) 90 if (keylist[i]->key == key_ && keylist[i]->mod == FbTk::KeyUtil::instance().isolateModifierMask(mod_))
90 return keylist[i]; 91 return keylist[i];
91 } 92 }
92 return 0; 93 return 0;
93 } 94 }
94 inline t_key *find(XKeyEvent &ke) { 95 inline t_key *find(XKeyEvent &ke) {
95 for (unsigned int i=0; i<keylist.size(); i++) { 96 for (unsigned int i=0; i<keylist.size(); i++) {
96 if (keylist[i]->key == ke.keycode && keylist[i]->mod == ke.state) 97 if (keylist[i]->key == ke.keycode &&
98 keylist[i]->mod == FbTk::KeyUtil::instance().isolateModifierMask(ke.state))
97 return keylist[i]; 99 return keylist[i];
98 } 100 }
99 return 0; 101 return 0;
100 } 102 }
101 103
102 inline bool operator == (XKeyEvent &ke) const { 104 inline bool operator == (XKeyEvent &ke) const {
103 return (mod == ke.state && key == ke.keycode); 105 return (mod == FbTk::KeyUtil::instance().isolateModifierMask(ke.state) && key == ke.keycode);
104 } 106 }
105 107
106 FbTk::RefCount<FbTk::Command> m_command; 108 FbTk::RefCount<FbTk::Command> m_command;