mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-20 05:33:47 -04:00
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).
This commit is contained in:
parent
fb5ab022de
commit
6d30e7d15d
4 changed files with 61 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue