Add onRelease option to <keybind>

...to make keybind actions fire on the release event rather then when the
key is first pressed. This is useful for binding actions to modifier keys
only. The most likely use-case for this is the binding of a Super key to a
menu, for example:

    <keybind key="Super_L" onRelease="yes">
      <action name="Execute" command="rofi -show drun"/>
    </keybind>

If another keybind is issued between the press and release, the on-release
keybind is cancelled.

Co-authored-by: @johanmalm
This commit is contained in:
Simon Long 2024-04-26 11:05:12 +01:00 committed by Johan Malm
parent f6c91c8d13
commit 84c222a84f
6 changed files with 51 additions and 5 deletions

View file

@ -492,6 +492,23 @@ extending outward from the snapped edge.
If set to "no" (or is absent) the keybind will be layout agnostic.
Default is no.
*<keyboard><keybind key="" onRelease="yes|no">*
*onRelease*, when yes, fires the keybind action when the key or key
combination is released, rather than first pressed. This is useful to
bind actions to only modifier keys, where the action should fire when
the modifier is used without another key. Default is no.
The example below will trigger the launch of rofi when the super key is
pressed & released, without interference from other multi-key
combinations that include the super key:
```
<keybind key="Super_L" onRelease="yes">
<action name="Execute" command="rofi -show drun"/>
</keybind>
```
*<keyboard><keybind key=""><action name="">*
Keybind action. See labwc-actions(5).