aboutsummaryrefslogtreecommitdiff
path: root/sway/input
diff options
context:
space:
mode:
authorLinus Heckemann <git@sphalerite.org>2020-03-23 12:34:04 +0100
committerSimon Ser <contact@emersion.fr>2020-03-30 14:18:27 +0200
commitdf48c48123de88a91362844881fa20eddc30f597 (patch)
tree307ec481503f0090519565dbf2c22b14e66ab5c0 /sway/input
parent5e41e6600beb7e80b5c621021e0b61a2a1dc0ac0 (diff)
downloadsway-df48c48123de88a91362844881fa20eddc30f597.tar.xz
add --no-repeat option for bindings
This allows e.g. triggering one command while a key is held, then triggering another to undo the change performed by it afterwards. One use case for this is triggering push-to-talk functionality for VoIP tools without granting them full access to all input events. Fixes #3151
Diffstat (limited to 'sway/input')
-rw-r--r--sway/input/keyboard.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sway/input/keyboard.c b/sway/input/keyboard.c
index 9c5f190e..30756acb 100644
--- a/sway/input/keyboard.c
+++ b/sway/input/keyboard.c
@@ -431,7 +431,8 @@ static void handle_key_event(struct sway_keyboard *keyboard,
// Set up (or clear) keyboard repeat for a pressed binding. Since the
// binding may remove the keyboard, the timer needs to be updated first
- if (binding && wlr_device->keyboard->repeat_info.delay > 0) {
+ if (binding && !(binding->flags & BINDING_NOREPEAT) &&
+ wlr_device->keyboard->repeat_info.delay > 0) {
keyboard->repeat_binding = binding;
if (wl_event_source_timer_update(keyboard->key_repeat_source,
wlr_device->keyboard->repeat_info.delay) < 0) {