mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-15 05:33:58 -04:00
input: remove the concept of "significant" modifiers
For the purpose of matching key bindings, "significant" modifiers are no more. We're really only interested in filtering out "locked" modifiers. We're already doing this, so there's no need to *also* match against a set of "significant" modifiers. Furthermore, we *never* want to consider locked keys (e.g. when emitting escapes to the client application), thus we can filter those out already when retrieving the set of active modifiers. The exception is the kitty keyboard protocol, which has support for CapsLock and NumLock. Since we're already re-retrieving the "consumed" modifiers (using the GTK style, rather than normal "XKB" style, to better match the kitty terminal), we might as well re-retrieve the effective modifiers as well.
This commit is contained in:
parent
4730ff8d08
commit
0aefc2c65d
8 changed files with 28 additions and 52 deletions
12
url-mode.c
12
url-mode.c
|
|
@ -145,28 +145,22 @@ void
|
|||
urls_input(struct seat *seat, struct terminal *term,
|
||||
const struct key_binding_set *bindings, uint32_t key,
|
||||
xkb_keysym_t sym, xkb_mod_mask_t mods, xkb_mod_mask_t consumed,
|
||||
xkb_mod_mask_t locked,
|
||||
const xkb_keysym_t *raw_syms, size_t raw_count,
|
||||
uint32_t serial)
|
||||
{
|
||||
const xkb_mod_mask_t bind_mods =
|
||||
mods & seat->kbd.bind_significant & ~locked;
|
||||
const xkb_mod_mask_t bind_consumed =
|
||||
consumed & seat->kbd.bind_significant & ~locked;
|
||||
|
||||
/* Key bindings */
|
||||
tll_foreach(bindings->url, it) {
|
||||
const struct key_binding *bind = &it->item;
|
||||
|
||||
/* Match translated symbol */
|
||||
if (bind->k.sym == sym &&
|
||||
bind->mods == (bind_mods & ~bind_consumed))
|
||||
bind->mods == (mods & ~consumed))
|
||||
{
|
||||
execute_binding(seat, term, bind, serial);
|
||||
return;
|
||||
}
|
||||
|
||||
if (bind->mods != bind_mods || bind_mods != (mods & ~locked))
|
||||
if (bind->mods != mods)
|
||||
continue;
|
||||
|
||||
for (size_t i = 0; i < raw_count; i++) {
|
||||
|
|
@ -196,7 +190,7 @@ urls_input(struct seat *seat, struct terminal *term,
|
|||
return;
|
||||
}
|
||||
|
||||
if (mods & ~consumed & ~locked)
|
||||
if (mods & ~consumed)
|
||||
return;
|
||||
|
||||
char32_t wc = xkb_state_key_get_utf32(seat->kbd.xkb_state, key);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue