aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/floating_mod.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands/floating_mod.c')
-rw-r--r--sway/commands/floating_mod.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/sway/commands/floating_mod.c b/sway/commands/floating_mod.c
deleted file mode 100644
index b8e81ab9..00000000
--- a/sway/commands/floating_mod.c
+++ /dev/null
@@ -1,42 +0,0 @@
1#include <string.h>
2#include <strings.h>
3#include "sway/commands.h"
4#include "sway/input_state.h"
5#include "list.h"
6#include "log.h"
7#include "stringop.h"
8#include "util.h"
9
10struct cmd_results *cmd_floating_mod(int argc, char **argv) {
11 struct cmd_results *error = NULL;
12 if ((error = checkarg(argc, "floating_modifier", EXPECTED_AT_LEAST, 1))) {
13 return error;
14 }
15 int i;
16 list_t *split = split_string(argv[0], "+");
17 config->floating_mod = 0;
18
19 // set modifier keys
20 for (i = 0; i < split->length; ++i) {
21 config->floating_mod |= get_modifier_mask_by_name(split->items[i]);
22 }
23 free_flat_list(split);
24 if (!config->floating_mod) {
25 error = cmd_results_new(CMD_INVALID, "floating_modifier", "Unknown keys %s", argv[0]);
26 return error;
27 }
28
29 if (argc >= 2) {
30 if (strcasecmp("inverse", argv[1]) == 0) {
31 config->dragging_key = M_RIGHT_CLICK;
32 config->resizing_key = M_LEFT_CLICK;
33 } else if (strcasecmp("normal", argv[1]) == 0) {
34 config->dragging_key = M_LEFT_CLICK;
35 config->resizing_key = M_RIGHT_CLICK;
36 } else {
37 error = cmd_results_new(CMD_INVALID, "floating_modifier", "Invalid definition %s", argv[1]);
38 return error;
39 }
40 }
41 return cmd_results_new(CMD_SUCCESS, NULL, NULL);
42}