mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-05-15 21:45:03 -04:00
search/url/unicode-mode: set last-shortcut-sym
When processing shortcuts, set seat->kbd.last_shortcut_sym. This ensures the corresponding release event is ignored in the main mode, if the shortcut triggered a mode exit. For example, pressing Return in search mode would exit search mode, and then immediately reset the search match, if the kitty keyboard protocol mode with release events were enabled.
This commit is contained in:
parent
43566b655f
commit
a2476536f9
3 changed files with 8 additions and 0 deletions
3
search.c
3
search.c
|
|
@ -1433,6 +1433,7 @@ search_input(struct seat *seat, struct terminal *term,
|
|||
&update_search_result, &search_direction,
|
||||
&redraw))
|
||||
{
|
||||
seat->kbd.last_shortcut_sym = sym;
|
||||
goto update_search;
|
||||
}
|
||||
return;
|
||||
|
|
@ -1451,6 +1452,7 @@ search_input(struct seat *seat, struct terminal *term,
|
|||
&update_search_result, &search_direction,
|
||||
&redraw))
|
||||
{
|
||||
seat->kbd.last_shortcut_sym = sym;
|
||||
goto update_search;
|
||||
}
|
||||
return;
|
||||
|
|
@ -1470,6 +1472,7 @@ search_input(struct seat *seat, struct terminal *term,
|
|||
&update_search_result, &search_direction,
|
||||
&redraw))
|
||||
{
|
||||
seat->kbd.last_shortcut_sym = sym;
|
||||
goto update_search;
|
||||
}
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ unicode_mode_input(struct seat *seat, struct terminal *term,
|
|||
term_to_slave(term, utf8, chars);
|
||||
}
|
||||
|
||||
seat->kbd.last_shortcut_sym = sym;
|
||||
unicode_mode_deactivate(term);
|
||||
}
|
||||
|
||||
|
|
@ -72,6 +73,7 @@ unicode_mode_input(struct seat *seat, struct terminal *term,
|
|||
sym == XKB_KEY_d ||
|
||||
sym == XKB_KEY_g)))
|
||||
{
|
||||
seat->kbd.last_shortcut_sym = sym;
|
||||
unicode_mode_deactivate(term);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -204,6 +204,7 @@ urls_input(struct seat *seat, struct terminal *term,
|
|||
for (size_t i = 0; i < raw_count; i++) {
|
||||
if (bind->k.sym == raw_syms[i]) {
|
||||
execute_binding(seat, term, bind, serial);
|
||||
seat->kbd.last_shortcut_sym = sym;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -217,6 +218,7 @@ urls_input(struct seat *seat, struct terminal *term,
|
|||
bind->mods == (mods & ~consumed))
|
||||
{
|
||||
execute_binding(seat, term, bind, serial);
|
||||
seat->kbd.last_shortcut_sym = sym;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -232,6 +234,7 @@ urls_input(struct seat *seat, struct terminal *term,
|
|||
tll_foreach(bind->k.key_codes, code) {
|
||||
if (code->item == key) {
|
||||
execute_binding(seat, term, bind, serial);
|
||||
seat->kbd.last_shortcut_sym = sym;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue