aboutsummaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-03-18 09:48:42 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-03-18 09:48:42 +0000
commitfb5ab022de00bf1b7b30c57e00ffaaf2beb16610 (patch)
treee117d085e6ff3f67ab574835250d33e74a68e890 /input.c
parentdoc: foot.5: spawn-terminal: mention OSC 7 (diff)
input: key-binding: log error when we fail to translate to XKB symbol
Diffstat (limited to 'input.c')
-rw-r--r--input.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/input.c b/input.c
index 7ca5e1ea..b9f1a7d0 100644
--- a/input.c
+++ b/input.c
@@ -117,7 +117,7 @@ input_parse_key_binding_for_action(
return true;
xkb_mod_mask_t mod_mask = 0;
- xkb_keysym_t sym = 0;
+ xkb_keysym_t sym = XKB_KEY_NoSymbol;
char *copy = strdup(combos);
@@ -146,11 +146,20 @@ input_parse_key_binding_for_action(
} else {
/* Symbol */
sym = xkb_keysym_from_name(key, 0);
+
+ if (sym == XKB_KEY_NoSymbol) {
+ LOG_ERR("%s: key binding is not a valid XKB symbol name",
+ key);
+ break;
+ }
}
}
LOG_DBG("action=%u: mods=0x%08x, sym=%d", action, mod_mask, sym);
+ if (sym == XKB_KEY_NoSymbol)
+ continue;
+
assert(sym != 0);
if (bindings != NULL) {
const struct key_binding binding = {