binds: add nested submaps example (#902)

* binds: add nested submaps example

* binds: refactor nested submaps example
This commit is contained in:
davc0n 2024-12-16 01:02:19 +01:00 committed by GitHub
parent 43543369a0
commit bf86ec8521
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -416,7 +416,43 @@ submap = reset
This works because the binds are executed in the order they appear, and This works because the binds are executed in the order they appear, and
assigning multiple actions per bind is possible. assigning multiple actions per bind is possible.
## Catch-All ### Nesting
Submaps can be nested, see the following example:
```ini
bind = $mainMod, M, submap, main_submap
submap = main_submap
# ...
# nested_one
bind = , 1, submap, nested_one
submap = nested_one
# ...
bind = SHIFT, escape, submap, reset
bind = , escape, submap, main_submap
submap = main_submap
# /nested_one
# nested_two
bind = , 2, submap, nested_two
submap = nested_two
# ...
bind = SHIFT, escape, submap, reset
bind = , escape, submap, main_submap
submap = main_submap
# /nested_two
bind = , escape, submap, reset
submap = reset
```
### Catch-All
You can also define a keybind via the special `catchall` keyword, which You can also define a keybind via the special `catchall` keyword, which
activates no matter which key is pressed. This can be used to prevent any keys activates no matter which key is pressed. This can be used to prevent any keys