2 #define I3__FILE__ "key_press.c"
4 * vim:ts=4:sw=4:expandtab
6 * i3 - an improved dynamic tiling window manager
7 * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
9 * key_press.c: key press handler
15 * There was a KeyPress or KeyRelease (both events have the same fields). We
16 * compare this key code with our bindings table and pass the bound action to
20 void handle_key_press(xcb_key_press_event_t *event) {
21 const bool key_release = (event->response_type == XCB_KEY_RELEASE);
23 last_timestamp = event->time;
25 DLOG("%s %d, state raw = 0x%x\n", (key_release ? "KeyRelease" : "KeyPress"), event->detail, event->state);
27 Binding *bind = get_binding_from_xcb_event((xcb_generic_event_t *)event);
29 /* if we couldn't find a binding, we are done */
33 CommandResult *result = run_binding(bind, NULL);
34 command_result_free(result);