From 96fde775604be02f2aeee04f3cd6d4edff2815bd Mon Sep 17 00:00:00 2001 From: Kurtis Lew Date: Sun, 30 Aug 2020 20:12:53 -0700 Subject: Update key-press.md Specified keypress and consumer press pages --- docs/docs/behavior/key-press.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/docs/behavior/key-press.md b/docs/docs/behavior/key-press.md index 2edce1d..f58225d 100644 --- a/docs/docs/behavior/key-press.md +++ b/docs/docs/behavior/key-press.md @@ -8,7 +8,7 @@ sidebar_label: Key Press The most basic of behaviors, is the ability to send certain keycode presses and releases in response to activating a certain key. -For reference on keycode values, see the [USB HID Usage Tables](https://www.usb.org/document-library/hid-usage-tables-12). +For reference on keycode values, see pages 83-89 of the [USB HID Usage Tables](https://www.usb.org/document-library/hid-usage-tables-12). ## Keycode Defines -- cgit v1.2.3 From ca0f2bb074a103b871a3e0f7f5e1fed8b6b4069b Mon Sep 17 00:00:00 2001 From: CrossR Date: Tue, 1 Sep 2020 18:32:45 +0100 Subject: Add to setup. --- docs/static/setup.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/static/setup.sh b/docs/static/setup.sh index 4dc740a..a32718d 100644 --- a/docs/static/setup.sh +++ b/docs/static/setup.sh @@ -38,7 +38,7 @@ echo "" echo "Keyboard Shield Selection:" prompt="Pick an keyboard:" -options=("Kyria" "Lily58" "Corne" "Splitreus62") +options=("Kyria" "Lily58" "Corne" "Splitreus62" "Sofle") PS3="$prompt " # TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos. @@ -51,6 +51,7 @@ select opt in "${options[@]}" "Quit"; do 2 ) shield_title="Lily58" shield="lily58"; split="y"; break;; 3 ) shield_title="Corne" shield="corne"; split="y"; break;; 4 ) shield_title="Splitreus62" shield="splitreus62"; split="y"; break;; + 5 ) shield_title="Sofle" shield="sofle"; split="y"; break;; # Add link to docs on adding your own custom shield in your ZMK config! # $(( ${#options[@]}+1 )) ) echo "Other!"; break;; -- cgit v1.2.3 From 29a23f018235ede8cfe65f5ede5014408eee879a Mon Sep 17 00:00:00 2001 From: Okke Formsma Date: Tue, 1 Sep 2020 16:04:58 +0200 Subject: Add tap-hold docs, update mod-tap docs --- docs/docs/assets/hold-tap/case1_2.png | Bin 0 -> 10323 bytes docs/docs/assets/hold-tap/case_hold_preferred.png | Bin 0 -> 6380 bytes docs/docs/assets/hold-tap/comparison.png | Bin 0 -> 158912 bytes docs/docs/behavior/hold-tap.md | 62 ++++++++++++++++++++++ docs/docs/behavior/mod-tap.md | 27 +++++++--- 5 files changed, 82 insertions(+), 7 deletions(-) create mode 100644 docs/docs/assets/hold-tap/case1_2.png create mode 100644 docs/docs/assets/hold-tap/case_hold_preferred.png create mode 100644 docs/docs/assets/hold-tap/comparison.png create mode 100644 docs/docs/behavior/hold-tap.md (limited to 'docs') diff --git a/docs/docs/assets/hold-tap/case1_2.png b/docs/docs/assets/hold-tap/case1_2.png new file mode 100644 index 0000000..818ac83 Binary files /dev/null and b/docs/docs/assets/hold-tap/case1_2.png differ diff --git a/docs/docs/assets/hold-tap/case_hold_preferred.png b/docs/docs/assets/hold-tap/case_hold_preferred.png new file mode 100644 index 0000000..6d7fd43 Binary files /dev/null and b/docs/docs/assets/hold-tap/case_hold_preferred.png differ diff --git a/docs/docs/assets/hold-tap/comparison.png b/docs/docs/assets/hold-tap/comparison.png new file mode 100644 index 0000000..419b204 Binary files /dev/null and b/docs/docs/assets/hold-tap/comparison.png differ diff --git a/docs/docs/behavior/hold-tap.md b/docs/docs/behavior/hold-tap.md new file mode 100644 index 0000000..b586b90 --- /dev/null +++ b/docs/docs/behavior/hold-tap.md @@ -0,0 +1,62 @@ +--- +title: Hold-tap behavior +sidebar_label: Hold-Tap +--- + +## Summary +Hold-tap is the basis for other behaviors such as layer-tap and mod-tap. + +Simply put, the hold-tap key will output the 'hold' behavior if it's held for a while, and output the 'tap' behavior when it's tapped quickly. + + +### Hold-Tap +The `tapping_term_ms` parameter decides between a 'tap' and a 'hold'. + +![Simple behavior](../assets/hold-tap/case1_2.png) + +By default, the hold-tap is configured to also select the 'hold' functionality if another key is tapped while it's active: + +![Hold preferred behavior](../assets/hold-tap/case1_2.png) + +We call this the 'hold-preferred' flavor of hold-taps. While this flavor may work very well for a ctrl/escape key, it's not very well suited for home-row mods or layer-taps. That's why there are two more flavors to choose from: 'tap-preferred' and 'balanced'. + +![Hold-tap comparison](../assets/hold-tap/comparison.png) + +### Configuration +A code example which configures a mod-tap setting that works with homerow mods: + +``` +#include +#include + +/ { + behaviors { + &hm: homerow_mods { + compatible = "zmk,behavior-hold-tap"; + label = "homerow_mods"; + #binding-cells = <2>; + tapping_term_ms = <175>; + flavor = "balanced"; + bindings = <&kp>, <&kp>; + }; + }; + + keymap { + compatible = "zmk,keymap"; + + default_layer { + bindings = < + &hm LCTL A &hm LGUI S &hm LALT D &hm LSFT F + >; + }; + }; +}; + +``` + +If this config does not work for you, try the flavor "tap-preferred" and a short tapping_term_ms such as 120ms. + +If you want to use a tap-hold with a keycode from a different code page, you have to define another behavior with another "bindings" parameter.For example, if you want to use SHIFT and volume up, define the bindings like `bindings = <&kp>, <&cp>;`. Only single-argument behaviors are supported at the moment. + +#### Note +Astute readers may notice similarities between the possible behaviors in ZMK and other firmware, such as QMK. The hold-preferred flavor works similar to the `HOLD_ON_OTHER_KEY_PRESS` setting. The 'balanced' flavor is similar to the `PERMISSIVE_HOLD` setting, and the `tap-preferred` flavor is similar to `IGNORE_MOD_TAP_INTERRUPT`. \ No newline at end of file diff --git a/docs/docs/behavior/mod-tap.md b/docs/docs/behavior/mod-tap.md index 08e9b65..cbe95e4 100644 --- a/docs/docs/behavior/mod-tap.md +++ b/docs/docs/behavior/mod-tap.md @@ -5,13 +5,9 @@ sidebar_label: Mod-Tap ## Summary -The Mod-Tap behavior allows varying the effect of pressing and releasing a key position depending -on whether it is used with other simultaneous key presses at the same time. +The Mod-Tap sends a different keypress, if it's tapped or held. When you tap the key shortly, the first keycode is sent. If you hold the key for longer than 200ms, the second keycode is sent. -If pressed and released independently, the Mod-Tap behavior will send the press and release events -for the configure keycode. If pressed and held while another key is pressed and released, then -the configured modifiers will be applied to that _other_ key press, and no press will be generated -on the release of the Mod-Tap key. +If you press another key within the 200ms, the 'mod' behavior is also activated. ## Mod-Tap @@ -20,7 +16,7 @@ The Mod-Tap behavior either acts as a held modifier, or as a tapped keycode. ### Behavior Binding - Reference: `&mt` -- Parameter #1: The modifiers to be used when activating as a modifier, e.g. `MOD_LSFT` +- Parameter #1: The keycode to be sent when activating as a modifier, e.g. `LSFT` - Parameter #2: The keycode to sent when used as a tap, e.g. `A`, `B`. Example: @@ -28,3 +24,20 @@ Example: ``` &mt MOD_LSFT A ``` + +### Configuration + +You can configure a different tapping term in your keymap: + +``` +&mt { + tapping_term_ms: <400>; +} + +/ { + keymap { + ... + } +} +``` + -- cgit v1.2.3 From c5ca66441172114b57ca7f7b27d13d0d342d4fcc Mon Sep 17 00:00:00 2001 From: Okke Formsma Date: Wed, 2 Sep 2020 15:11:56 +0200 Subject: some fixes based on feedback --- docs/docs/behavior/mod-tap.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/docs/behavior/mod-tap.md b/docs/docs/behavior/mod-tap.md index cbe95e4..dcac492 100644 --- a/docs/docs/behavior/mod-tap.md +++ b/docs/docs/behavior/mod-tap.md @@ -22,7 +22,7 @@ The Mod-Tap behavior either acts as a held modifier, or as a tapped keycode. Example: ``` -&mt MOD_LSFT A +&mt LSFT A ``` ### Configuration -- cgit v1.2.3 From c9a82d71d06146dfe706a2e8d223dab593dffffc Mon Sep 17 00:00:00 2001 From: Okke Formsma Date: Wed, 2 Sep 2020 16:41:39 +0200 Subject: fixes for feedback round 2 --- docs/docs/behavior/hold-tap.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/docs/behavior/hold-tap.md b/docs/docs/behavior/hold-tap.md index b586b90..fa68538 100644 --- a/docs/docs/behavior/hold-tap.md +++ b/docs/docs/behavior/hold-tap.md @@ -31,9 +31,9 @@ A code example which configures a mod-tap setting that works with homerow mods: / { behaviors { - &hm: homerow_mods { + hm: homerow_mods { compatible = "zmk,behavior-hold-tap"; - label = "homerow_mods"; + label = "HOMEROW_MODS"; #binding-cells = <2>; tapping_term_ms = <175>; flavor = "balanced"; -- cgit v1.2.3