aboutsummaryrefslogtreecommitdiff
path: root/src/Keys.cc
diff options
context:
space:
mode:
authormarkt <markt>2007-11-22 20:21:47 (GMT)
committermarkt <markt>2007-11-22 20:21:47 (GMT)
commitbb6906fa80c06fc23975d7520b3e8919423a29b4 (patch)
tree214427a1221e350ce62e08e0656678d260ccf10f /src/Keys.cc
parent58cd017db04b83d0cb3b24882d1ba7471ec4d6e1 (diff)
downloadfluxbox-bb6906fa80c06fc23975d7520b3e8919423a29b4.zip
fluxbox-bb6906fa80c06fc23975d7520b3e8919423a29b4.tar.bz2
added special FocusIn/Out MouseOver/Out ChangeWorkspace keys
Diffstat (limited to 'src/Keys.cc')
-rw-r--r--src/Keys.cc33
1 files changed, 29 insertions, 4 deletions
diff --git a/src/Keys.cc b/src/Keys.cc
index 2d26ab8..f3cd092 100644
--- a/src/Keys.cc
+++ b/src/Keys.cc
@@ -307,10 +307,35 @@ bool Keys::addBinding(const string &linebuffer) {
307 context |= ON_WINDOW; 307 context |= ON_WINDOW;
308 else if (strcasecmp("NONE",val[argc].c_str())) { 308 else if (strcasecmp("NONE",val[argc].c_str())) {
309 // check if it's a mouse button 309 // check if it's a mouse button
310 if (!strcasecmp(val[argc].substr(0,5).c_str(), "mouse") && 310 if (strcasecmp("focusin", val[argc].c_str()) == 0) {
311 val[argc].length() > 5) { 311 context = ON_WINDOW;
312 mod = key = 0;
313 type = FocusIn;
314 } else if (strcasecmp("focusout", val[argc].c_str()) == 0) {
315 context = ON_WINDOW;
316 mod = key = 0;
317 type = FocusOut;
318 } else if (strcasecmp("changeworkspace",
319 val[argc].c_str()) == 0) {
320 context = ON_DESKTOP;
321 mod = key = 0;
322 type = FocusIn;
323 } else if (strcasecmp("mouseover", val[argc].c_str()) == 0) {
324 type = EnterNotify;
325 if (!(context & (ON_WINDOW|ON_TOOLBAR)))
326 context |= ON_WINDOW;
327 key = 0;
328 } else if (strcasecmp("mouseout", val[argc].c_str()) == 0) {
329 type = LeaveNotify;
330 if (!(context & (ON_WINDOW|ON_TOOLBAR)))
331 context |= ON_WINDOW;
332 key = 0;
333 } else if (strcasecmp(val[argc].substr(0,5).c_str(),
334 "mouse") == 0 &&
335 val[argc].length() > 5) {
312 type = ButtonPress; 336 type = ButtonPress;
313 key = atoi(val[argc].substr(5,val[argc].length()-5).c_str()); 337 key = atoi(val[argc].substr(5,
338 val[argc].length()-5).c_str());
314 // keycode covers the following three two-byte cases: 339 // keycode covers the following three two-byte cases:
315 // 0x - hex 340 // 0x - hex
316 // +[1-9] - number between +1 and +9 341 // +[1-9] - number between +1 and +9
@@ -331,7 +356,7 @@ bool Keys::addBinding(const string &linebuffer) {
331 type = KeyPress; 356 type = KeyPress;
332 } 357 }
333 358
334 if (key == 0) 359 if (key == 0 && (type == KeyPress || type == ButtonPress))
335 return false; 360 return false;
336 if (!first_new_key) { 361 if (!first_new_key) {
337 first_new_keylist = current_key; 362 first_new_keylist = current_key;