diff options
Diffstat (limited to 'sway/commands.c')
-rw-r--r-- | sway/commands.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/sway/commands.c b/sway/commands.c index 8a087af8..205798ec 100644 --- a/sway/commands.c +++ b/sway/commands.c | |||
@@ -375,14 +375,14 @@ static struct cmd_results *cmd_floating(int argc, char **argv) { | |||
375 | 375 | ||
376 | static struct cmd_results *cmd_floating_mod(int argc, char **argv) { | 376 | static struct cmd_results *cmd_floating_mod(int argc, char **argv) { |
377 | struct cmd_results *error = NULL; | 377 | struct cmd_results *error = NULL; |
378 | if ((error = checkarg(argc, "floating_modifier", EXPECTED_EQUAL_TO, 1))) { | 378 | if ((error = checkarg(argc, "floating_modifier", EXPECTED_AT_LEAST, 1))) { |
379 | return error; | 379 | return error; |
380 | } | 380 | } |
381 | int i, j; | 381 | int i, j; |
382 | list_t *split = split_string(argv[0], "+"); | 382 | list_t *split = split_string(argv[0], "+"); |
383 | config->floating_mod = 0; | 383 | config->floating_mod = 0; |
384 | 384 | ||
385 | // set modifer keys | 385 | // set modifier keys |
386 | for (i = 0; i < split->length; ++i) { | 386 | for (i = 0; i < split->length; ++i) { |
387 | for (j = 0; j < (int)(sizeof(modifiers) / sizeof(struct modifier_key)); ++j) { | 387 | for (j = 0; j < (int)(sizeof(modifiers) / sizeof(struct modifier_key)); ++j) { |
388 | if (strcasecmp(modifiers[j].name, split->items[i]) == 0) { | 388 | if (strcasecmp(modifiers[j].name, split->items[i]) == 0) { |
@@ -395,6 +395,19 @@ static struct cmd_results *cmd_floating_mod(int argc, char **argv) { | |||
395 | error = cmd_results_new(CMD_INVALID, "floating_modifier", "Unknown keys %s", argv[0]); | 395 | error = cmd_results_new(CMD_INVALID, "floating_modifier", "Unknown keys %s", argv[0]); |
396 | return error; | 396 | return error; |
397 | } | 397 | } |
398 | |||
399 | if (argc >= 2) { | ||
400 | if (strcasecmp("inverse", argv[1]) == 0) { | ||
401 | config->dragging_key = M_RIGHT_CLICK; | ||
402 | config->resizing_key = M_LEFT_CLICK; | ||
403 | } else if (strcasecmp("normal", argv[1]) == 0) { | ||
404 | config->dragging_key = M_LEFT_CLICK; | ||
405 | config->resizing_key = M_RIGHT_CLICK; | ||
406 | } else { | ||
407 | error = cmd_results_new(CMD_INVALID, "floating_modifier", "Invalid definition %s", argv[1]); | ||
408 | return error; | ||
409 | } | ||
410 | } | ||
398 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); | 411 | return cmd_results_new(CMD_SUCCESS, NULL, NULL); |
399 | } | 412 | } |
400 | 413 | ||