modholdandtap implementation

This commit is contained in:
Syed Hussaini
2022-04-22 13:35:49 -05:00
committed by xs5871
parent bd87b278b8
commit bce7959f66
3 changed files with 198 additions and 0 deletions

24
docs/modholdandtap.md Normal file
View File

@@ -0,0 +1,24 @@
# ModHoldAndTap
This module allows to immitate the behaviour of ATL+TAB or CMD+TAB, etc.
Basically, it will hold the mod and tap a key on a layer other than default layer. The mod will be released when any other key is pressed or the layer key is released.
The key will do nothing when it is placed on the default layer
## Enabling the module
```python
from kmk.module.modholdandtap import ModHoldAndTap
modholdandtap = ModHoldAndTap()
keyboard.modules.append(modholdandtap)
keyboard.keymap = [
[
KC.MHAT(kc=KC.TAB, mod=KC.LALT),
KC.MHAT(KC.TAB, KC.LSFT(KC.LALT)),
],
]
```
## Keycodes
|Key |Description |
|-------------------------|-----------------------------------------------|
|`KC.MHAT(KC.key, KC.mod)`|holds the mod and taps the key |