Add support for bincode command

If a bindsym and bincode maps to the same combination, the last one will
overwrite any previous mappings.
This commit is contained in:
Mikkel Oscar Lyderik 2016-01-09 17:40:19 +01:00
parent cb8ac7fd4a
commit f8b260d4a1
5 changed files with 105 additions and 7 deletions

View file

@ -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;
}
}
}