aboutsummaryrefslogtreecommitdiff
path: root/sway/commands/bind.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-06-14 18:53:40 -0400
committerGitHub <noreply@github.com>2017-06-14 18:53:40 -0400
commit298f56353ef155f6a2ccc977c96b2ff5d971e65e (patch)
treedcb3b74f1dde93bce8657b7509662ffd7db667d0 /sway/commands/bind.c
parenta5c07dde6aba87584ddb6c6a2769472a6003623a (diff)
parenteb6e38c86d2deb37cc6f378f8644c4a530fd7448 (diff)
Merge branch 'master' into server-decoration
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 @@
#include <xkbcommon/xkbcommon.h>
#include <xkbcommon/xkbcommon-names.h>
+#include <strings.h>
#include "sway/commands.h"
#include "sway/config.h"
+#include "sway/input_state.h"
#include "list.h"
#include "log.h"
#include "stringop.h"
@@ -52,6 +54,12 @@ struct cmd_results *cmd_bindsym(int argc, char **argv) {
// Check for xkb key
xkb_keysym_t sym = xkb_keysym_from_name(split->items[i],
XKB_KEYSYM_CASE_INSENSITIVE);
+
+ // Check for mouse binding
+ if (strncasecmp(split->items[i], "button", strlen("button")) == 0 &&
+ strlen(split->items[i]) == strlen("button0")) {
+ sym = ((char *)split->items[i])[strlen("button")] - '1' + M_LEFT_CLICK;
+ }
if (!sym) {
free_sway_binding(binding);
free_flat_list(split);