aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2025-01-31 06:35:54 +0000
committerDaniel Eklöf <daniel@ekloef.se>2025-01-31 06:35:54 +0000
commitbee17a95b86a640522c25e650e13aebc82c7353d (patch)
tree249ddaf3c348c48be96a7a939739226d454acf6c
parentkey-bindings: add keypad variants to existing default key-bindings (diff)
input: ignore key-bindings without modifiers when matching untranslated/raw
When matching the unshifted symbol, or the raw key code, ignore all key bindings that don't have any modifiers. This fixes an issue where it was impossible to enter (some of the) numbers on the keypad, **if** there was a key-binding for e.g. KP_Page_Up, or KP_Page_Down.
-rw-r--r--input.c4
-rw-r--r--search.c4
-rw-r--r--url-mode.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/input.c b/input.c
index a2f30a0c..22566411 100644
--- a/input.c
+++ b/input.c
@@ -1600,7 +1600,7 @@ key_press_release(struct seat *seat, struct terminal *term, uint32_t serial,
tll_foreach(bindings->key, it) {
const struct key_binding *bind = &it->item;
- if (bind->mods != mods)
+ if (bind->mods != mods || bind->mods == 0)
continue;
for (size_t i = 0; i < raw_count; i++) {
@@ -1616,7 +1616,7 @@ key_press_release(struct seat *seat, struct terminal *term, uint32_t serial,
tll_foreach(bindings->key, it) {
const struct key_binding *bind = &it->item;
- if (bind->mods != mods)
+ if (bind->mods != mods || bind->mods == 0)
continue;
tll_foreach(bind->k.key_codes, code) {
diff --git a/search.c b/search.c
index bcb354d6..75f12b4a 100644
--- a/search.c
+++ b/search.c
@@ -1413,7 +1413,7 @@ search_input(struct seat *seat, struct terminal *term,
tll_foreach(bindings->search, it) {
const struct key_binding *bind = &it->item;
- if (bind->mods != mods)
+ if (bind->mods != mods || bind->mods == 0)
continue;
for (size_t i = 0; i < raw_count; i++) {
@@ -1433,7 +1433,7 @@ search_input(struct seat *seat, struct terminal *term,
tll_foreach(bindings->search, it) {
const struct key_binding *bind = &it->item;
- if (bind->mods != mods)
+ if (bind->mods != mods || bind->mods == 0)
continue;
tll_foreach(bind->k.key_codes, code) {
diff --git a/url-mode.c b/url-mode.c
index cca7bd22..83dbfa70 100644
--- a/url-mode.c
+++ b/url-mode.c
@@ -198,7 +198,7 @@ urls_input(struct seat *seat, struct terminal *term,
/* Match untranslated symbols */
tll_foreach(bindings->url, it) {
const struct key_binding *bind = &it->item;
- if (bind->mods != mods)
+ if (bind->mods != mods || bind->mods == 0)
continue;
for (size_t i = 0; i < raw_count; i++) {
@@ -212,7 +212,7 @@ urls_input(struct seat *seat, struct terminal *term,
/* Match raw key code */
tll_foreach(bindings->url, it) {
const struct key_binding *bind = &it->item;
- if (bind->mods != mods)
+ if (bind->mods != mods || bind->mods == 0)
continue;
/* Match raw key code */