mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-12 05:34:01 -04:00
search: add support for user configurable key bindings
No default bindings defined yet, though.
This commit is contained in:
parent
fcf4832775
commit
0d188895c3
5 changed files with 31 additions and 9 deletions
19
input.c
19
input.c
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue