diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2019-05-30 03:30:08 -0400 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2019-05-30 10:47:42 +0300 |
commit | 6afb392823d27ec69bedc8fd74263c3d072cca29 (patch) | |
tree | a1a72a233a2ef8e89240b7702d7c9eabb3444bf0 /sway/sway.5.scd | |
parent | Provide current DPMS state in GET_OUTPUTS (diff) | |
download | sway-6afb392823d27ec69bedc8fd74263c3d072cca29.tar.gz sway-6afb392823d27ec69bedc8fd74263c3d072cca29.tar.zst sway-6afb392823d27ec69bedc8fd74263c3d072cca29.zip |
bindings: allow unlocked and locked bindings
This changes the behavior of bindings to make the `BINDING_LOCKED` flag
conflicting, which will allow for both unlocked and locked bindings.
If there are two matching bindings and one has `--locked` and the other
does not, the one with `--locked` will be preferred when locked and
the one without will be preferred when unlocked.
If there are two matching bindings and one has both a matching
`--input-device=<input>` and `--locked` and the other has neither, the
former will be preferred for both unlocked and locked.
This also refactors `get_active_binding` in `sway/input/keyboard.c`
to make it easier to read.
Diffstat (limited to 'sway/sway.5.scd')
-rw-r--r-- | sway/sway.5.scd | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/sway/sway.5.scd b/sway/sway.5.scd index 74963c9d..6d098d94 100644 --- a/sway/sway.5.scd +++ b/sway/sway.5.scd | |||
@@ -331,12 +331,17 @@ runtime. | |||
331 | Binds _key combo_ to execute the sway command _command_ when pressed. You | 331 | Binds _key combo_ to execute the sway command _command_ when pressed. You |
332 | may use XKB key names here (*xev*(1) is a good tool for discovering these). | 332 | may use XKB key names here (*xev*(1) is a good tool for discovering these). |
333 | With the flag _--release_, the command is executed when the key combo is | 333 | With the flag _--release_, the command is executed when the key combo is |
334 | released. Unless the flag _--locked_ is set, the command will not be run | 334 | released. If _input-device_ is given, the binding will only be executed for |
335 | when a screen locking program is active. If _input-device_ is given, the | 335 | that input device and will be executed instead of any binding that is |
336 | binding will only be executed for that input device and will be executed | 336 | generic to all devices. By default, if you overwrite a binding, swaynag |
337 | instead of any binding that is generic to all devices. By default, if you | 337 | will give you a warning. To silence this, use the _--no-warn_ flag. |
338 | overwrite a binding, swaynag will give you a warning. To silence this, use | 338 | |
339 | the _--no-warn_ flag. | 339 | Unless the flag _--locked_ is set, the command will not be run when a |
340 | screen locking program is active. If there is a matching binding with | ||
341 | and without _--locked_, the one with will be preferred when locked and the | ||
342 | one without will be preferred when unlocked. If there are matching bindings | ||
343 | and one has both _--input-device_ and _--locked_ and the other has neither, | ||
344 | the former will be preferred even when unlocked. | ||
340 | 345 | ||
341 | Bindings to keysyms are layout-dependent. This can be changed with the | 346 | Bindings to keysyms are layout-dependent. This can be changed with the |
342 | _--to-code_ flag. In this case, the keysyms will be translated into the | 347 | _--to-code_ flag. In this case, the keysyms will be translated into the |
@@ -380,10 +385,13 @@ runtime. | |||
380 | respectively. _toggle_ is also supported to run a command both when the | 385 | respectively. _toggle_ is also supported to run a command both when the |
381 | switch is toggled on or off. | 386 | switch is toggled on or off. |
382 | 387 | ||
383 | Unless the flag _--locked_ is set, the command will not be run | 388 | Unless the flag _--locked_ is set, the command will not be run when a |
384 | when a screen locking program is active. By default, if you | 389 | screen locking program is active. If there is a matching binding with |
385 | overwrite a binding, swaynag will give you a warning. To silence this, use | 390 | and without _--locked_, the one with will be preferred when locked and the |
386 | the _--no-warn_ flag. | 391 | one without will be preferred when unlocked. |
392 | |||
393 | By default, if you overwrite a binding, swaynag will give you a warning. To | ||
394 | silence this, use the _--no-warn_ flag. | ||
387 | 395 | ||
388 | Example: | 396 | Example: |
389 | ``` | 397 | ``` |