summaryrefslogtreecommitdiff
path: root/sway/handlers.c
diff options
context:
space:
mode:
authorMikkel Oscar Lyderik <[email protected]>2016-01-09 17:40:19 +0100
committerMikkel Oscar Lyderik <[email protected]>2016-01-09 18:07:47 +0100
commitf8b260d4a1295df68ef1ff7db89f21e6032d64c7 (patch)
tree228810591abade5a021f6b2ea1da8f22826f4ee9 /sway/handlers.c
parentcb8ac7fd4a0c8c11f97cc913391c4d04a7b4277b (diff)
Add support for bincode command
If a bindsym and bincode maps to the same combination, the last one will overwrite any previous mappings.
Diffstat (limited to 'sway/handlers.c')
-rw-r--r--sway/handlers.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sway/handlers.c b/sway/handlers.c
index 76778450..60bfac87 100644
--- a/sway/handlers.c
+++ b/sway/handlers.c
@@ -363,9 +363,16 @@ static bool handle_bindsym(struct sway_binding *binding) {
bool match = false;
int i;
for (i = 0; i < binding->keys->length; ++i) {
- xkb_keysym_t *key = binding->keys->items[i];
- if ((match = check_key(*key, 0)) == false) {
- break;
+ if (binding->bindcode) {
+ xkb_keycode_t *key = binding->keys->items[i];
+ if ((match = check_key(0, *key)) == false) {
+ break;
+ }
+ } else {
+ xkb_keysym_t *key = binding->keys->items[i];
+ if ((match = check_key(*key, 0)) == false) {
+ break;
+ }
}
}