kmk_firmware/docs/modtap.md
xs5871 a62d39a252
make TapDance a module (#281)
* extract tapdance logic into a module

* clean out old tapdance code

* canonicalize key variable names

* split _process_tap_dance into td_pressed and td_released

* implement consistent argument order

* update documentation

* implement Module.process_key for key interception and modification

* fix tapdance realesing instead of pressing

* fix: default parameters in key handler

* cleanup holdtap

* add error handling to modules process_key

* fix: key released too late

Tapped keys didn't release on a "key released" event, but waited for a
timeout. Resulted in, for example, modifiers applying to keys after the
modifier was released.

* fix lint/formatting

* fix tap_time reference in modtap + minimal documentation

* fix lint
2022-01-18 05:21:05 +00:00

2.1 KiB

ModTap Keycodes

Enabling ModTap will give you access to the following keycodes and can simply be added to the modules list.

from kmk.modules.modtap import ModTap
modtap = ModTap()
# optional: set a custom tap timeout in ms
# modtap.tap_time = 300
keyboard.modules.append(modtap)

Keycodes

New Keycode Description
LCTL = KC.MT(KC.SOMETHING, KC.LCTRL) LCTRL if held kc if tapped
LSFT = KC.MT(KC.SOMETHING, KC.LSFT) LSHIFT if held kc if tapped
LALT = KC.MT(KC.SOMETHING, KC.LALT) LALT if held kc if tapped
LGUI = KC.MT(KC.SOMETHING, KC.LGUI) LGUI if held kc if tapped
RCTL = KC.MT(KC.SOMETHING, KC.RCTRL) RCTRL if held kc if tapped
RSFT = KC.MT(KC.SOMETHING, KC.RSFT) RSHIFT if held kc if tapped
RALT = KC.MT(KC.SOMETHING, KC.RALT) RALT if held kc if tapped
RGUI = KC.MT(KC.SOMETHING, KC.RGUI) RGUI if held kc if tapped
SGUI = KC.MT(KC.SOMETHING, KC.LSHFT(KC.LGUI)) LSHIFT and LGUI if held kc if tapped
LCA = KC.MT(KC.SOMETHING, KC.LCTRL(KC.LALT)) LCTRL and LALT if held kc if tapped
LCAG = KC.MT(KC.SOMETHING, KC.LCTRL(KC.LALT(KC.LGUI))) LCTRL and LALT and LGUI if held kc if tapped
MEH = KC.MT(KC.SOMETHING, KC.LCTRL(KC.LSFT(KC.LALT))) CTRL and LSHIFT and LALT if held kc if tapped
HYPR = KC.MT(KC.SOMETHING, KC.HYPR) LCTRL and LSHIFT and LALT and LGUI if held kc if tapped