aboutsummaryrefslogtreecommitdiff
path: root/wayland.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-03-18 13:29:34 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-03-18 13:29:34 +0000
commit6d30e7d15de49ba531cd8f8cd99c356d7f1ca0fc (patch)
tree7285ce10fd19d2cfe7cf74b93a1f5268b88177d0 /wayland.h
parentinput: key-binding: log error when we fail to translate to XKB symbol (diff)
input: bind key bindings to raw key codes too
Before, when looking for a matching user key binding, we only matched *symbols*. This means that the physical keys that generate a specific key binding is layout dependent. What's worse, it may not even be possible to generate the key binding at all. Russian is one such layout, where all the "normal" (us) symbols are replaced. By using raw key codes, we can get around this - the key code has a direct mapping to the physical key. However, matching raw key codes **only** doesn't always make sense either. For now, match **both** symbols _and_ key codes. Symbols take precedence. TODO: we might have to make this configurable _per binding_. Note: 'search' mode still uses mostly hardcoded shortcuts that still have this problem (i.e. ctrl+g doesn't work with a russian layout).
Diffstat (limited to 'wayland.h')
-rw-r--r--wayland.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/wayland.h b/wayland.h
index 70b21d4b..6ad46d83 100644
--- a/wayland.h
+++ b/wayland.h
@@ -84,9 +84,12 @@ enum binding_action {
BIND_ACTION_COUNT,
};
+typedef tll(xkb_keycode_t) xkb_keycode_list_t;
+
struct key_binding {
xkb_mod_mask_t mods;
xkb_keysym_t sym;
+ xkb_keycode_list_t key_codes;
enum binding_action action;
};
typedef tll(struct key_binding) key_binding_list_t;