mirror of
https://github.com/swaywm/sway.git
synced 2025-11-06 13:29:50 -05:00
floating_modifier uses mod_keys instead of anykey
This commit is contained in:
parent
2d3bd3c747
commit
8205a6fd3b
2 changed files with 22 additions and 7 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue