summaryrefslogtreecommitdiff
path: root/sway/commands.c
diff options
context:
space:
mode:
authorDrew DeVault <[email protected]>2015-12-14 17:14:49 -0500
committerDrew DeVault <[email protected]>2015-12-14 17:14:49 -0500
commit42a85431eec1472e18cf886e02a629cda46f8123 (patch)
tree1bd0b17ccd7f8465ec6dcd07fef2753383da06c6 /sway/commands.c
parentfa0f57cd045ef13aff02a9c25bf0c46226f1b55b (diff)
parent82af08d8e9c6b3d1770f022ed0e38e79bba582ea (diff)
Merge pull request #320 from mikkeloscar/configure-mouse-btn2
Lookup dragging key when in dragging 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) {
static struct cmd_results *cmd_floating_mod(int argc, char **argv) {
struct cmd_results *error = NULL;
- if ((error = checkarg(argc, "floating_modifier", EXPECTED_EQUAL_TO, 1))) {
+ if ((error = checkarg(argc, "floating_modifier", EXPECTED_AT_LEAST, 1))) {
return error;
}
int i, j;
list_t *split = split_string(argv[0], "+");
config->floating_mod = 0;
- // set modifer keys
+ // set modifier keys
for (i = 0; i < split->length; ++i) {
for (j = 0; j < (int)(sizeof(modifiers) / sizeof(struct modifier_key)); ++j) {
if (strcasecmp(modifiers[j].name, split->items[i]) == 0) {
@@ -406,6 +406,19 @@ static struct cmd_results *cmd_floating_mod(int argc, char **argv) {
error = cmd_results_new(CMD_INVALID, "floating_modifier", "Unknown keys %s", argv[0]);
return error;
}
+
+ if (argc >= 2) {
+ if (strcasecmp("inverse", argv[1]) == 0) {
+ config->dragging_key = M_RIGHT_CLICK;
+ config->resizing_key = M_LEFT_CLICK;
+ } else if (strcasecmp("normal", argv[1]) == 0) {
+ config->dragging_key = M_LEFT_CLICK;
+ config->resizing_key = M_RIGHT_CLICK;
+ } else {
+ error = cmd_results_new(CMD_INVALID, "floating_modifier", "Invalid definition %s", argv[1]);
+ return error;
+ }
+ }
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}