My I3-Emacs Integration
Key takeaways
- We 14 * compare this key code with our bindings table and pass the bound action to 15 * parse_command().
- this looks like a reasonable place to make a change!
- i decided to modify Binding (include/data.h) with an extra field to indicate a class of window which sh
We 14 * compare this key code with our bindings table and pass the bound action to 15 * parse_command(). 16 * 17 */ 18void handle_key_press(xcb_key_press_event_t *event) { 19 const bool key_release = (event->response_type == XCB_KEY_RELEASE); 20 21 last_timestamp = event->time; 22 23 DLOG("%s %d, state raw = 0x%x\n", (key_release ? "KeyRelease" : "KeyPress"), event->detail, event->state); 24 25 Binding *bind = get_binding_from_xcb_event((xcb_generic_event_t *)event); 26 27 /* if we couldn't find a binding, we are done */ 28 if (bind == NULL) { 29 return; 30 } 31 32 CommandResult *result = run_binding(bind, NULL); 33 command_result_free(result); 34} notably, this function receives the original xcb_key_press_event_t from xcb, which (after a bit of reading and experimentation) i realized you could just re-emit diretly via xcb_send_event(). unfortunately, the window receiving the event will still lose focus, as i3 is intercepting key events globally. i haven't fixed this; let me know if you know how.
this looks like a reasonable place to make a change!
i decided to modify Binding (include/data.h) with an extra field to indicate a class of window which sh