-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tap-hold docs, update mod-tap docs
- Loading branch information
1 parent
5ce6509
commit 5a58b26
Showing
5 changed files
with
82 additions
and
7 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <behaviors.dtsi> | ||
#include <dt-bindings/zmk/keys.h> | ||
/ { | ||
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`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters