aboutsummaryrefslogtreecommitdiff
path: root/sway/commands
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands')
-rw-r--r--sway/commands/bind.c14
-rw-r--r--sway/commands/seat/cursor.c2
2 files changed, 13 insertions, 3 deletions
diff --git a/sway/commands/bind.c b/sway/commands/bind.c
index 701d9746..5832d01e 100644
--- a/sway/commands/bind.c
+++ b/sway/commands/bind.c
@@ -26,6 +26,7 @@ void free_sway_binding(struct sway_binding *binding) {
if (binding->keys) {
free_flat_list(binding->keys);
}
+ free(binding->input);
free(binding->command);
free(binding);
}
@@ -37,6 +38,10 @@ void free_sway_binding(struct sway_binding *binding) {
*/
static bool binding_key_compare(struct sway_binding *binding_a,
struct sway_binding *binding_b) {
+ if (strcmp(binding_a->input, binding_b->input) != 0) {
+ return false;
+ }
+
if (binding_a->type != binding_b->type) {
return false;
}
@@ -149,6 +154,7 @@ static struct cmd_results *cmd_bindsym_or_bindcode(int argc, char **argv,
return cmd_results_new(CMD_FAILURE, bindtype,
"Unable to allocate binding");
}
+ binding->input = strdup("*");
binding->keys = create_list();
binding->modifiers = 0;
binding->flags = 0;
@@ -168,6 +174,10 @@ static struct cmd_results *cmd_bindsym_or_bindcode(int argc, char **argv,
binding->flags |= BINDING_BORDER;
} else if (strcmp("--exclude-titlebar", argv[0]) == 0) {
exclude_titlebar = true;
+ } else if (strncmp("--input-device=", argv[0],
+ strlen("--input-device=")) == 0) {
+ free(binding->input);
+ binding->input = strdup(argv[0] + strlen("--input-device="));
} else {
break;
}
@@ -257,8 +267,8 @@ static struct cmd_results *cmd_bindsym_or_bindcode(int argc, char **argv,
list_add(mode_bindings, binding);
}
- wlr_log(WLR_DEBUG, "%s - Bound %s to command %s",
- bindtype, argv[0], binding->command);
+ wlr_log(WLR_DEBUG, "%s - Bound %s to command `%s` for device '%s'",
+ bindtype, argv[0], binding->command, binding->input);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}
diff --git a/sway/commands/seat/cursor.c b/sway/commands/seat/cursor.c
index cd6630e0..595e9bc6 100644
--- a/sway/commands/seat/cursor.c
+++ b/sway/commands/seat/cursor.c
@@ -80,6 +80,6 @@ static struct cmd_results *press_or_release(struct sway_cursor *cursor,
return cmd_results_new(CMD_INVALID, "cursor", expected_syntax);
}
}
- dispatch_cursor_button(cursor, 0, button, state);
+ dispatch_cursor_button(cursor, NULL, 0, button, state);
return cmd_results_new(CMD_SUCCESS, NULL, NULL);
}