aboutsummaryrefslogtreecommitdiff
path: root/sway/commands.c
diff options
context:
space:
mode:
authortaiyu <taiyu.len@gmail.com>2015-08-19 09:09:35 -0700
committertaiyu <taiyu.len@gmail.com>2015-08-19 09:09:35 -0700
commit8205a6fd3bb544b11c9d56abc93da02b03543297 (patch)
tree8c72c9dea88dcbccf078fe2344c6de81dd5de255 /sway/commands.c
parent2d3bd3c74772e72ed6119549428150c7318fe456 (diff)
floating_modifier uses mod_keys instead of anykey
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/sway/commands.c b/sway/commands.c
index cc51717b..37bd9b00 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -240,7 +240,24 @@ static bool cmd_floating_mod(struct sway_config *config, int argc, char **argv)
if (!checkarg(argc, "floating_modifier", EXPECTED_EQUAL_TO, 1)) {
return false;
}
- config->floating_mod = xkb_keysym_from_name(argv[0], XKB_KEYSYM_CASE_INSENSITIVE);
+ int i, j;
+ list_t *split = split_string(argv[0], "+");
+ fprintf(stderr,"%s, %d,%d\n",argv[0], split->length,split->items);
+ config->floating_mod = 0;
+
+ //set modifer keys
+ for (i = 0; i < split->length; ++i) {
+ for (j = 0; j < sizeof(modifiers) / sizeof(struct modifier_key); ++j) {
+ if (strcasecmp(modifiers[j].name, split->items[i]) == 0) {
+ config->floating_mod |= modifiers[j].mod;
+ }
+ }
+ }
+ list_free(split);
+ if (!config->floating_mod) {
+ sway_log(L_ERROR, "bindsym - unknown keys %s", argv[0]);
+ return false;
+ }
return true;
}