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.
This commit is contained in:
Daniel Eklöf 2025-01-31 07:35:54 +01:00
parent d24f700256
commit bee17a95b8
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
3 changed files with 6 additions and 6 deletions

View file

@ -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) {

View file

@ -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) {

View file

@ -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 */