aboutsummaryrefslogtreecommitdiff
path: root/url-mode.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2024-02-06 09:41:01 +0000
committerDaniel Eklöf <daniel@ekloef.se>2024-02-06 10:08:42 +0000
commit0aefc2c65de8cca39ddbf9d8c12f1a4d4206b42a (patch)
tree9411699ddb755ea24454bf2774190c5f50874283 /url-mode.c
parentinput/config: support *all* modifier names (diff)
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.
Diffstat (limited to 'url-mode.c')
-rw-r--r--url-mode.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/url-mode.c b/url-mode.c
index 1b28f8e0..07499794 100644
--- a/url-mode.c
+++ b/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);