aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/sway/commands.c b/sway/commands.c
index a394c69d..aa4cb89e 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -386,14 +386,14 @@ static struct cmd_results *cmd_floating(int argc, char **argv) {
386 386
387static struct cmd_results *cmd_floating_mod(int argc, char **argv) { 387static struct cmd_results *cmd_floating_mod(int argc, char **argv) {
388 struct cmd_results *error = NULL; 388 struct cmd_results *error = NULL;
389 if ((error = checkarg(argc, "floating_modifier", EXPECTED_EQUAL_TO, 1))) { 389 if ((error = checkarg(argc, "floating_modifier", EXPECTED_AT_LEAST, 1))) {
390 return error; 390 return error;
391 } 391 }
392 int i, j; 392 int i, j;
393 list_t *split = split_string(argv[0], "+"); 393 list_t *split = split_string(argv[0], "+");
394 config->floating_mod = 0; 394 config->floating_mod = 0;
395 395
396 // set modifer keys 396 // set modifier keys
397 for (i = 0; i < split->length; ++i) { 397 for (i = 0; i < split->length; ++i) {
398 for (j = 0; j < (int)(sizeof(modifiers) / sizeof(struct modifier_key)); ++j) { 398 for (j = 0; j < (int)(sizeof(modifiers) / sizeof(struct modifier_key)); ++j) {
399 if (strcasecmp(modifiers[j].name, split->items[i]) == 0) { 399 if (strcasecmp(modifiers[j].name, split->items[i]) == 0) {
@@ -406,6 +406,19 @@ static struct cmd_results *cmd_floating_mod(int argc, char **argv) {
406 error = cmd_results_new(CMD_INVALID, "floating_modifier", "Unknown keys %s", argv[0]); 406 error = cmd_results_new(CMD_INVALID, "floating_modifier", "Unknown keys %s", argv[0]);
407 return error; 407 return error;
408 } 408 }
409
410 if (argc >= 2) {
411 if (strcasecmp("inverse", argv[1]) == 0) {
412 config->dragging_key = M_RIGHT_CLICK;
413 config->resizing_key = M_LEFT_CLICK;
414 } else if (strcasecmp("normal", argv[1]) == 0) {
415 config->dragging_key = M_LEFT_CLICK;
416 config->resizing_key = M_RIGHT_CLICK;
417 } else {
418 error = cmd_results_new(CMD_INVALID, "floating_modifier", "Invalid definition %s", argv[1]);
419 return error;
420 }
421 }
409 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 422 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
410} 423}
411 424