-#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 <glib.h>
void plugin_setup_config()
{
+ parse_reg_section("keyboard", keyparse, NULL);
}
-KeyBindingTree *firstnode;
+KeyBindingTree *firstnode = NULL;
static KeyBindingTree *curpos;
static guint reset_key, reset_state;
if (grabbed) {
grabbed = FALSE;
grab_keyboard(FALSE);
- }
+ } else
+ XAllowEvents(ob_display, AsyncKeyboard, event_lasttime);
}
gboolean kbind(GList *keylist, Action *action)
return FALSE;
if ((t = tree_find(tree, &conflict)) != NULL) {
/* already bound to something */
- g_warning("keychain is already bound");
+ g_message("keychain is already bound");
tree_destroy(tree);
return FALSE;
}
if (conflict) {
- g_warning("conflict with binding");
+ g_message("conflict with binding");
tree_destroy(tree);
return FALSE;
}
if (!grabbed) {
grab_keyboard(TRUE);
grabbed = TRUE;
+ XAllowEvents(ob_display, AsyncKeyboard,
+ event_lasttime);
}
curpos = p;
} else {
p = p->next_sibling;
}
}
- XAllowEvents(ob_display, AsyncKeyboard, e->data.x.e->xkey.time);
}
void plugin_startup()
{
+ curpos = NULL;
+ grabbed = FALSE;
+
dispatch_register(Event_X_KeyPress, (EventHandler)press, NULL);
translate_key("C-g", &reset_state, &reset_key);
-
- keysrc_parse();
}
void plugin_shutdown()