aboutsummaryrefslogtreecommitdiff
path: root/sway/config.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2016-01-09 12:10:37 -0500
committerDrew DeVault <sir@cmpwn.com>2016-01-09 12:10:37 -0500
commit7388e1ecd8ba90f80156837d550087334a2935db (patch)
tree74976999f5b0aab279bc87691f4ce8af2e0ba9a9 /sway/config.c
parentb4ea9d492cf6b7c4cd871cfc4da98547596acd63 (diff)
parentf8b260d4a1295df68ef1ff7db89f21e6032d64c7 (diff)
Merge pull request #442 from mikkeloscar/bincode
Add support for bincode command
Diffstat (limited to 'sway/config.c')
-rw-r--r--sway/config.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/sway/config.c b/sway/config.c
index d923eea5..ae6a02b1 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -652,15 +652,27 @@ int sway_binding_cmp_keys(const void *a, const void *b) {
} else if (binda->modifiers < bindb->modifiers) {
return -1;
}
+ struct wlc_modifiers no_mods = { 0, 0 };
for (int i = 0; i < binda->keys->length; i++) {
- xkb_keysym_t *ka = binda->keys->items[i],
- *kb = bindb->keys->items[i];
- if (*ka > *kb) {
+ xkb_keysym_t ka = *(xkb_keysym_t *)binda->keys->items[i],
+ kb = *(xkb_keysym_t *)bindb->keys->items[i];
+ if (binda->bindcode) {
+ uint32_t *keycode = binda->keys->items[i];
+ ka = wlc_keyboard_get_keysym_for_key(*keycode, &no_mods);
+ }
+
+ if (bindb->bindcode) {
+ uint32_t *keycode = bindb->keys->items[i];
+ kb = wlc_keyboard_get_keysym_for_key(*keycode, &no_mods);
+ }
+
+ if (ka > kb) {
return 1;
- } else if (*ka < *kb) {
+ } else if (ka < kb) {
return -1;
}
}
+
return 0;
}