diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-03-08 14:28:47 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-03-08 14:28:47 +0000 |
| commit | 0d188895c3e88f591aa47f7a5c272ad959e5a40d (patch) | |
| tree | b93ee2b188e8b86ad090df08a2817abd928400e4 /input.c | |
| parent | input: convert the rest of the normal key bindings to configurable bindings (diff) | |
search: add support for user configurable key bindings
No default bindings defined yet, though.
Diffstat (limited to 'input.c')
| -rw-r--r-- | input.c | 19 |
1 files changed, 12 insertions, 7 deletions
@@ -31,9 +31,9 @@ #include "terminal.h" #include "vt.h" -static void -execute_binding(struct terminal *term, enum binding_action action, - uint32_t serial) +void +input_execute_binding(struct terminal *term, enum binding_action action, + uint32_t serial) { switch (action) { case BIND_ACTION_SCROLLBACK_UP: @@ -196,8 +196,13 @@ keyboard_keymap(void *data, struct wl_keyboard *wl_keyboard, close(fd); for (size_t i = 0; i < BIND_ACTION_COUNT; i++) { - const char *combos = wayl->conf->bindings.key[i]; - parse_key_binding_for_action(wayl->kbd.xkb_keymap, i, combos, &wayl->kbd.bindings.key); + parse_key_binding_for_action( + wayl->kbd.xkb_keymap, i, + wayl->conf->bindings.key[i], &wayl->kbd.bindings.key); + + parse_key_binding_for_action( + wayl->kbd.xkb_keymap, i, + wayl->conf->bindings.search[i], &wayl->kbd.bindings.search); } } @@ -476,7 +481,7 @@ keyboard_key(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, if (term->is_searching) { if (should_repeat) start_repeater(wayl, key - 8); - search_input(term, key, sym, effective_mods); + search_input(term, key, sym, effective_mods, serial); return; } @@ -497,7 +502,7 @@ keyboard_key(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, */ tll_foreach(wayl->kbd.bindings.key, it) { if (it->item.mods == effective_mods && it->item.sym == sym) { - execute_binding(term, it->item.action, serial); + input_execute_binding(term, it->item.action, serial); goto maybe_repeat; } } |
