X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=plugins%2Fkeyboard%2Fkeyboard.c;h=add2b473d665a01e887d08dab78ff33a5c2bf0f7;hb=68ff2eb3d2d7874e780000143cbee9a8e7c2e57f;hp=2b3f3e5a804515bfab901308023849dea12817f7;hpb=91ebde9e8842678e0d0704dc7945b2b84aba314f;p=chaz%2Fopenbox diff --git a/plugins/keyboard/keyboard.c b/plugins/keyboard/keyboard.c index 2b3f3e5a..add2b473 100644 --- a/plugins/keyboard/keyboard.c +++ b/plugins/keyboard/keyboard.c @@ -1,15 +1,19 @@ -#include "../../kernel/focus.h" -#include "../../kernel/dispatch.h" -#include "../../kernel/openbox.h" -#include "../../kernel/grab.h" -#include "../../kernel/action.h" +#include "kernel/focus.h" +#include "kernel/dispatch.h" +#include "kernel/openbox.h" +#include "kernel/event.h" +#include "kernel/grab.h" +#include "kernel/action.h" +#include "kernel/parse.h" #include "tree.h" #include "keyboard.h" -#include "keysrc.h" +#include "keyparse.h" +#include "translate.h" #include void plugin_setup_config() { + parse_reg_section("keyboard", keyparse); } KeyBindingTree *firstnode; @@ -38,7 +42,8 @@ static void reset_chains() if (grabbed) { grabbed = FALSE; grab_keyboard(FALSE); - } + } else + XAllowEvents(ob_display, AsyncKeyboard, event_lasttime); } gboolean kbind(GList *keylist, Action *action) @@ -49,10 +54,8 @@ gboolean kbind(GList *keylist, Action *action) g_assert(keylist != NULL); g_assert(action != NULL); - if (!(tree = tree_build(keylist))) { - g_warning("invalid binding"); + if (!(tree = tree_build(keylist))) return FALSE; - } if ((t = tree_find(tree, &conflict)) != NULL) { /* already bound to something */ g_warning("keychain is already bound"); @@ -102,6 +105,8 @@ static void press(ObEvent *e, void *foo) if (!grabbed) { grab_keyboard(TRUE); grabbed = TRUE; + XAllowEvents(ob_display, AsyncKeyboard, + event_lasttime); } curpos = p; } else { @@ -121,14 +126,13 @@ static void press(ObEvent *e, void *foo) p = p->next_sibling; } } - XAllowEvents(ob_display, AsyncKeyboard, e->data.x.e->xkey.time); } void plugin_startup() { dispatch_register(Event_X_KeyPress, (EventHandler)press, NULL); - keysrc_parse(); + translate_key("C-g", &reset_state, &reset_key); } void plugin_shutdown()