aboutsummaryrefslogtreecommitdiff
path: root/src/Keys.hh
diff options
context:
space:
mode:
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;