mirror of
https://github.com/swaywm/sway.git
synced 2026-03-22 05:34:04 -04:00
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
This commit is contained in:
parent
5e41e6600b
commit
df48c48123
4 changed files with 10 additions and 2 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue