aboutsummaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-03-12 09:46:27 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-03-12 09:46:27 +0000
commitc58f9a9ef93fd3fd2be711906b8214a53665e45f (patch)
treee760cd598211e03c91e4ff03a5acf7f444b48011 /input.c
parentchangelog: user configurable key- and mouse bindings (diff)
config: mouse-bindings: verify button isn't already mapped
A button may only be mapped to a single action. Detect when the user tried to map the same button to multiple actions and error out. To clear a binding (for example, to free up a button from the default bindings), one can set the action it is bound to to `NONE` (e.g. `primary-paste=NONE`).
Diffstat (limited to 'input.c')
-rw-r--r--input.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/input.c b/input.c
index 8fbb02cd..1c80dd8b 100644
--- a/input.c
+++ b/input.c
@@ -38,6 +38,9 @@ input_execute_binding(struct terminal *term, enum binding_action action,
uint32_t serial)
{
switch (action) {
+ case BIND_ACTION_NONE:
+ break;
+
case BIND_ACTION_SCROLLBACK_UP:
cmd_scrollback_up(term, term->rows);
break;
@@ -1168,6 +1171,7 @@ wl_pointer_button(void *data, struct wl_pointer *wl_pointer,
}
input_execute_binding(term, binding->action, serial);
+ break;
}
selection_cancel(term);
}