summaryrefslogtreecommitdiffstats
path: root/sway/commands/bind.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/commands/bind.c')
-rw-r--r--sway/commands/bind.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sway/commands/bind.c b/sway/commands/bind.c
index 8282277b..af5a01e5 100644
--- a/sway/commands/bind.c
+++ b/sway/commands/bind.c
@@ -1,7 +1,9 @@
1#include <xkbcommon/xkbcommon.h> 1#include <xkbcommon/xkbcommon.h>
2#include <xkbcommon/xkbcommon-names.h> 2#include <xkbcommon/xkbcommon-names.h>
3#include <strings.h>
3#include "sway/commands.h" 4#include "sway/commands.h"
4#include "sway/config.h" 5#include "sway/config.h"
6#include "sway/input_state.h"
5#include "list.h" 7#include "list.h"
6#include "log.h" 8#include "log.h"
7#include "stringop.h" 9#include "stringop.h"
@@ -52,6 +54,12 @@ struct cmd_results *cmd_bindsym(int argc, char **argv) {
52 // Check for xkb key 54 // Check for xkb key
53 xkb_keysym_t sym = xkb_keysym_from_name(split->items[i], 55 xkb_keysym_t sym = xkb_keysym_from_name(split->items[i],
54 XKB_KEYSYM_CASE_INSENSITIVE); 56 XKB_KEYSYM_CASE_INSENSITIVE);
57
58 // Check for mouse binding
59 if (strncasecmp(split->items[i], "button", strlen("button")) == 0 &&
60 strlen(split->items[i]) == strlen("button0")) {
61 sym = ((char *)split->items[i])[strlen("button")] - '1' + M_LEFT_CLICK;
62 }
55 if (!sym) { 63 if (!sym) {
56 free_sway_binding(binding); 64 free_sway_binding(binding);
57 free_flat_list(split); 65 free_flat_list(split);