X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=plugins%2Fkeyboard%2Fkeyboard.c;h=9b9c0882da295c6d2e1bed453299fafd889b5300;hb=ac735b647c9915a40fc3c44a04f7f5f7cacb4278;hp=141bb5b1a1e2a706918c021e777d053caf5025c2;hpb=4bcd03b2d0904e2b5443a2383b66055422240255;p=chaz%2Fopenbox diff --git a/plugins/keyboard/keyboard.c b/plugins/keyboard/keyboard.c index 141bb5b1..9b9c0882 100644 --- a/plugins/keyboard/keyboard.c +++ b/plugins/keyboard/keyboard.c @@ -7,6 +7,10 @@ #include "keyboard.h" #include +void plugin_setup_config() +{ +} + KeyBindingTree *firstnode; static KeyBindingTree *curpos; @@ -16,13 +20,11 @@ static gboolean grabbed; static void grab_keys(gboolean grab) { if (!grab) { - XUngrabKey(ob_display, AnyKey, AnyModifier, ob_root); + ungrab_all_keys(); } else { KeyBindingTree *p = firstnode; while (p) { - /* XXX grab all lock keys too */ - XGrabKey(ob_display, p->key, p->state, ob_root, FALSE, - GrabModeAsync, GrabModeSync); + grab_key(p->key, p->state, GrabModeSync); p = p->next_sibling; } } @@ -85,7 +87,6 @@ static void press(ObEvent *e, void *foo) if (e->data.x.e->xkey.keycode == reset_key && e->data.x.e->xkey.state == reset_state) { reset_chains(); - XAllowEvents(ob_display, AsyncKeyboard, CurrentTime); } else { KeyBindingTree *p; if (curpos == NULL) @@ -100,7 +101,6 @@ static void press(ObEvent *e, void *foo) if (!grabbed) { grab_keyboard(TRUE); grabbed = TRUE; - XAllowEvents(ob_display, AsyncKeyboard, CurrentTime); } curpos = p; } else { @@ -113,7 +113,6 @@ static void press(ObEvent *e, void *foo) p->action->func(&p->action->data); } - XAllowEvents(ob_display, AsyncKeyboard, CurrentTime); reset_chains(); } break; @@ -121,6 +120,7 @@ static void press(ObEvent *e, void *foo) p = p->next_sibling; } } + XAllowEvents(ob_display, AsyncKeyboard, e->data.x.e->xkey.time); } static void binddef() @@ -133,40 +133,45 @@ static void binddef() at call-time when then action function is used. */ - list->data = "C-Right"; + list->data = "A-Right"; a = action_new(action_next_desktop); a->data.nextprevdesktop.wrap = TRUE; kbind(list, a); - list->data = "C-Left"; + list->data = "A-Left"; a = action_new(action_previous_desktop); a->data.nextprevdesktop.wrap = TRUE; kbind(list, a); - list->data = "C-1"; + list->data = "A-1"; a = action_new(action_desktop); a->data.desktop.desk = 0; kbind(list, a); - list->data = "C-2"; + list->data = "A-2"; a = action_new(action_desktop); a->data.desktop.desk = 1; kbind(list, a); - list->data = "C-3"; + list->data = "A-3"; a = action_new(action_desktop); a->data.desktop.desk = 2; kbind(list, a); - list->data = "C-4"; + list->data = "A-4"; a = action_new(action_desktop); a->data.desktop.desk = 3; kbind(list, a); - list->data = "C-space"; + list->data = "A-space"; a = action_new(action_execute); a->data.execute.path = g_strdup("xterm"); kbind(list, a); + + list->data = "C-A-Escape"; + a = action_new(action_execute); + a->data.execute.path = g_strdup("xlock -nolock -mode puzzle"); + kbind(list, a); } void plugin_startup()