2022-04-28 18:05:59 +02:00
|
|
|
# Sticky Mod
|
2022-04-29 16:38:12 +02:00
|
|
|
This module allows to hold a modifier while a key is being tapped repeatedly; the modifier will be released when any other key is pressed or released.
|
|
|
|
This is for example useful if you want to switch between open windows with ALT+TAB or CMD+TAB, using only a single key.
|
2022-04-28 18:05:59 +02:00
|
|
|
|
|
|
|
## Enabling the module
|
|
|
|
```python
|
2022-08-05 19:23:01 +02:00
|
|
|
from kmk.modules.sticky_mod import StickyMod
|
2022-04-28 18:05:59 +02:00
|
|
|
sticky_mod = StickyMod()
|
|
|
|
keyboard.modules.append(sticky_mod)
|
|
|
|
keyboard.keymap = [
|
|
|
|
[
|
|
|
|
KC.SM(kc=KC.TAB, mod=KC.LALT),
|
|
|
|
KC.SM(KC.TAB, KC.LSFT(KC.LALT)),
|
|
|
|
],
|
|
|
|
]
|
|
|
|
```
|
|
|
|
|
|
|
|
## Keycodes
|
|
|
|
|
|
|
|
|Key |Description |
|
|
|
|
|-------------------------|-----------------------------------------------|
|
|
|
|
|`KC.SM(KC.key, KC.mod)` |sticky mod |
|