aboutsummaryrefslogtreecommitdiff
path: root/src/Keys.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/Keys.hh')
-rw-r--r--src/Keys.hh11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Keys.hh b/src/Keys.hh
index a8684ed..f5c8cea 100644
--- a/src/Keys.hh
+++ b/src/Keys.hh
@@ -79,7 +79,8 @@ public:
79 /** 79 /**
80 do action from XKeyEvent; return false if not bound to anything 80 do action from XKeyEvent; return false if not bound to anything
81 */ 81 */
82 bool doAction(int type, unsigned int mods, unsigned int key, int context); 82 bool doAction(int type, unsigned int mods, unsigned int key, int context,
83 Time time = 0);
83 84
84 /// register a window so that proper keys/buttons get grabbed on it 85 /// register a window so that proper keys/buttons get grabbed on it
85 void registerWindow(Window win, FbTk::EventHandler &handler, int context); 86 void registerWindow(Window win, FbTk::EventHandler &handler, int context);
@@ -113,18 +114,19 @@ private:
113 class t_key { 114 class t_key {
114 public: 115 public:
115 t_key(int type, unsigned int mod, unsigned int key, int context, 116 t_key(int type, unsigned int mod, unsigned int key, int context,
116 FbTk::RefCount<FbTk::Command> command = FbTk::RefCount<FbTk::Command>(0)); 117 bool isdouble);
117 t_key(t_key *k); 118 t_key(t_key *k);
118 ~t_key(); 119 ~t_key();
119 120
120 t_key *find(int type_, unsigned int mod_, unsigned int key_, 121 t_key *find(int type_, unsigned int mod_, unsigned int key_,
121 int context_) { 122 int context_, bool isdouble_) {
122 // t_key ctor sets context_ of 0 to GLOBAL, so we must here too 123 // t_key ctor sets context_ of 0 to GLOBAL, so we must here too
123 context_ = context_ ? context_ : GLOBAL; 124 context_ = context_ ? context_ : GLOBAL;
124 keylist_t::iterator it = keylist.begin(), it_end = keylist.end(); 125 keylist_t::iterator it = keylist.begin(), it_end = keylist.end();
125 for (; it != it_end; it++) { 126 for (; it != it_end; it++) {
126 if ((*it)->type == type_ && (*it)->key == key_ && 127 if ((*it)->type == type_ && (*it)->key == key_ &&
127 ((*it)->context & context_) > 0 && (*it)->mod == 128 ((*it)->context & context_) > 0 &&
129 isdouble_ == (*it)->isdouble && (*it)->mod ==
128 FbTk::KeyUtil::instance().isolateModifierMask(mod_)) 130 FbTk::KeyUtil::instance().isolateModifierMask(mod_))
129 return *it; 131 return *it;
130 } 132 }
@@ -137,6 +139,7 @@ private:
137 int type; // KeyPress or ButtonPress 139 int type; // KeyPress or ButtonPress
138 unsigned int key; // key code or button number 140 unsigned int key; // key code or button number
139 unsigned int mod; 141 unsigned int mod;
142 bool isdouble;
140 keylist_t keylist; 143 keylist_t keylist;
141 }; 144 };
142 145