diff options
author | Linus Heckemann <git@sphalerite.org> | 2020-03-23 12:34:04 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2020-03-30 14:18:27 +0200 |
commit | df48c48123de88a91362844881fa20eddc30f597 (patch) | |
tree | 307ec481503f0090519565dbf2c22b14e66ab5c0 /sway/input/keyboard.c | |
parent | Change focus_on_window_activation default to urgent (diff) | |
download | sway-df48c48123de88a91362844881fa20eddc30f597.tar.gz sway-df48c48123de88a91362844881fa20eddc30f597.tar.zst sway-df48c48123de88a91362844881fa20eddc30f597.zip |
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/keyboard.c')
-rw-r--r-- | sway/input/keyboard.c | 3 |
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, | |||
431 | 431 | ||
432 | // Set up (or clear) keyboard repeat for a pressed binding. Since the | 432 | // Set up (or clear) keyboard repeat for a pressed binding. Since the |
433 | // binding may remove the keyboard, the timer needs to be updated first | 433 | // binding may remove the keyboard, the timer needs to be updated first |
434 | if (binding && wlr_device->keyboard->repeat_info.delay > 0) { | 434 | if (binding && !(binding->flags & BINDING_NOREPEAT) && |
435 | wlr_device->keyboard->repeat_info.delay > 0) { | ||
435 | keyboard->repeat_binding = binding; | 436 | keyboard->repeat_binding = binding; |
436 | if (wl_event_source_timer_update(keyboard->key_repeat_source, | 437 | if (wl_event_source_timer_update(keyboard->key_repeat_source, |
437 | wlr_device->keyboard->repeat_info.delay) < 0) { | 438 | wlr_device->keyboard->repeat_info.delay) < 0) { |