From f8b260d4a1295df68ef1ff7db89f21e6032d64c7 Mon Sep 17 00:00:00 2001 From: Mikkel Oscar Lyderik Date: Sat, 9 Jan 2016 17:40:19 +0100 Subject: Add support for bincode command If a bindsym and bincode maps to the same combination, the last one will overwrite any previous mappings. --- sway/handlers.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'sway/handlers.c') 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; + } } } -- cgit v1.2.3