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 /search.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 'search.c')
| -rw-r--r-- | search.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -11,6 +11,7 @@ #define LOG_ENABLE_DBG 0 #include "log.h" #include "grid.h" +#include "input.h" #include "misc.h" #include "render.h" #include "selection.h" @@ -412,7 +413,8 @@ distance_prev_word(const struct terminal *term) } void -search_input(struct terminal *term, uint32_t key, xkb_keysym_t sym, xkb_mod_mask_t mods) +search_input(struct terminal *term, uint32_t key, xkb_keysym_t sym, + xkb_mod_mask_t mods, uint32_t serial) { LOG_DBG("search: input: sym=%d/0x%x, mods=0x%08x", sym, sym, mods); @@ -424,6 +426,16 @@ search_input(struct terminal *term, uint32_t key, xkb_keysym_t sym, xkb_mod_mask enum xkb_compose_status compose_status = xkb_compose_state_get_status( term->wl->kbd.xkb_compose_state); + /* + * User configurable bindings + */ + tll_foreach(term->wl->kbd.bindings.search, it) { + if (it->item.mods == mods && it->item.sym == sym) { + input_execute_binding(term, it->item.action, serial); + return; + } + } + /* Cancel search */ if ((mods == 0 && sym == XKB_KEY_Escape) || (mods == ctrl && sym == XKB_KEY_g)) |
