From 481c69b212849a9ba1c4bc92cb483648cbc88ebc Mon Sep 17 00:00:00 2001 From: xs5871 Date: Mon, 7 Feb 2022 18:39:31 +0000 Subject: [PATCH] add at least some kind of documentation --- docs/layers.md | 5 ++++- docs/modtap.md | 13 +++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/layers.md b/docs/layers.md index 7c59169..8245bdd 100644 --- a/docs/layers.md +++ b/docs/layers.md @@ -7,7 +7,7 @@ from kmk.modules.layers import Layers keyboard.modules.append(Layers()) ``` - ## Keycodes +## Keycodes |Key |Description | |-----------------|------------------------------------------------------------------------| @@ -19,3 +19,6 @@ keyboard.modules.append(Layers()) |`KC.TO(layer)` |Activates layer and deactivates all other layers | |`KC.TT(layer)` |Momentarily activates layer if held, toggles it if tapped repeatedly | +## Custom HoldTap Behavior +`KC.TT` and `KC.LT` use the same heuristic to determine taps and holds as +ModTap. Check out the [ModTap doc](modtap.md) to find out more. diff --git a/docs/modtap.md b/docs/modtap.md index 66cd092..c351b15 100644 --- a/docs/modtap.md +++ b/docs/modtap.md @@ -28,4 +28,17 @@ keyboard.modules.append(modtap) |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| +## Custom HoldTap Behavior +The full ModTap signature is as follows: +```python +KC.MT(KC.TAP, KC.HOLD, prefer_hold=True, tap_interrupted=False, tap_time=None) +``` +* `prefer_hold`: decides which keycode the ModTap key resolves to when another + key is pressed before the timeout finishes. When `True` the hold keycode is + choosen, the tap keycode when `False`. +* `tap_interrupted`: decides if the timeout will interrupt at the first other + key press/down, or after the first other key up/release. Set to `True` for + interrupt on release. +* `tap_time`: length of the tap timeout in milliseconds. +Each of these parameters can be set for every ModTap key individually.