style(hold-tap)!: Write hold-tap params with dashes

tapping_term_ms -> tapping-term-ms
quick_tap_ms -> quick-tap-ms

The old style works, although it's deprecated.
This commit is contained in:
Okke Formsma 2021-02-06 21:47:21 +01:00 committed by Pete Johanson
parent 2af794eed3
commit af9d6e9b05
12 changed files with 25 additions and 22 deletions

View file

@ -18,7 +18,7 @@
compatible = "zmk,behavior-hold-tap"; compatible = "zmk,behavior-hold-tap";
label = "homerow mods"; label = "homerow mods";
#binding-cells = <2>; #binding-cells = <2>;
tapping_term_ms = <225>; tapping-term-ms = <225>;
flavor = "tap-preferred"; flavor = "tap-preferred";
bindings = <&kp>, <&kp>; bindings = <&kp>, <&kp>;
}; };

View file

@ -14,7 +14,7 @@
compatible = "zmk,behavior-hold-tap"; compatible = "zmk,behavior-hold-tap";
label = "Hold Tap"; label = "Hold Tap";
#binding-cells = <2>; #binding-cells = <2>;
tapping_term_ms = <200>; tapping-term-ms = <200>;
flavor = "tap-preferred"; flavor = "tap-preferred";
bindings = <&kp>, <&kp>; bindings = <&kp>, <&kp>;
}; };

View file

@ -11,7 +11,7 @@
label = "LAYER_TAP"; label = "LAYER_TAP";
#binding-cells = <2>; #binding-cells = <2>;
flavor = "tap-preferred"; flavor = "tap-preferred";
tapping_term_ms = <200>; tapping-term-ms = <200>;
bindings = <&mo>, <&kp>; bindings = <&mo>, <&kp>;
}; };
}; };

View file

@ -11,7 +11,7 @@
label = "MOD_TAP"; label = "MOD_TAP";
#binding-cells = <2>; #binding-cells = <2>;
flavor = "hold-preferred"; flavor = "hold-preferred";
tapping_term_ms = <200>; tapping-term-ms = <200>;
bindings = <&kp>, <&kp>; bindings = <&kp>, <&kp>;
}; };
}; };

View file

@ -11,11 +11,15 @@ properties:
bindings: bindings:
type: phandles type: phandles
required: true required: true
tapping_term_ms: tapping-term-ms:
type: int type: int
quick_tap_ms: tapping_term_ms: # deprecated
type: int
quick-tap-ms:
type: int type: int
default: -1 default: -1
quick_tap_ms: # deprecated
type: int
flavor: flavor:
type: string type: string
required: false required: false

View file

@ -47,7 +47,6 @@ struct behavior_hold_tap_config {
// this data is specific for each hold-tap // this data is specific for each hold-tap
struct active_hold_tap { struct active_hold_tap {
int32_t position; int32_t position;
// todo: move these params into the config->behaviors->tap and
uint32_t param_hold; uint32_t param_hold;
uint32_t param_tap; uint32_t param_tap;
int64_t timestamp; int64_t timestamp;

View file

@ -9,8 +9,8 @@
label = "HOLD_TAP_BALANCED"; label = "HOLD_TAP_BALANCED";
#binding-cells = <2>; #binding-cells = <2>;
flavor = "balanced"; flavor = "balanced";
tapping_term_ms = <300>; tapping-term-ms = <300>;
quick_tap_ms = <200>; quick-tap-ms = <200>;
bindings = <&kp>, <&kp>; bindings = <&kp>, <&kp>;
}; };
}; };

View file

@ -9,7 +9,7 @@
label = "HOLD_TAP_BALANCED"; label = "HOLD_TAP_BALANCED";
#binding-cells = <2>; #binding-cells = <2>;
flavor = "balanced"; flavor = "balanced";
tapping_term_ms = <300>; tapping-term-ms = <300>;
bindings = <&kp>, <&kp>; bindings = <&kp>, <&kp>;
}; };
}; };

View file

@ -11,8 +11,8 @@
label = "hold_hold_tap"; label = "hold_hold_tap";
#binding-cells = <2>; #binding-cells = <2>;
flavor = "hold-preferred"; flavor = "hold-preferred";
tapping_term_ms = <300>; tapping-term-ms = <300>;
quick_tap_ms = <200>; quick-tap-ms = <200>;
bindings = <&kp>, <&kp>; bindings = <&kp>, <&kp>;
}; };
}; };

View file

@ -9,8 +9,8 @@
label = "MOD_TAP"; label = "MOD_TAP";
#binding-cells = <2>; #binding-cells = <2>;
flavor = "tap-preferred"; flavor = "tap-preferred";
tapping_term_ms = <300>; tapping-term-ms = <300>;
quick_tap_ms = <200>; quick-tap-ms = <200>;
bindings = <&kp>, <&kp>; bindings = <&kp>, <&kp>;
}; };
}; };

View file

@ -23,9 +23,9 @@ We call this the 'hold-preferred' flavor of hold-taps. While this flavor may wor
#### Flavors #### Flavors
- The 'hold-preferred' flavor triggers the hold behavior when the `tapping_term_ms` has expired or another key is pressed. - The 'hold-preferred' flavor triggers the hold behavior when the `tapping-term-ms` has expired or another key is pressed.
- The 'balanced' flavor will trigger the hold behavior when the `tapping_term_ms` has expired or another key is pressed and released. - The 'balanced' flavor will trigger the hold behavior when the `tapping-term-ms` has expired or another key is pressed and released.
- The 'tap-preferred' flavor triggers the hold behavior when the `tapping_term_ms` has expired. It triggers the tap behavior when another key is pressed. - The 'tap-preferred' flavor triggers the hold behavior when the `tapping-term-ms` has expired. It triggers the tap behavior when another key is pressed.
When the hold-tap key is released and the hold behavior has not been triggered, the tap behavior will trigger. When the hold-tap key is released and the hold behavior has not been triggered, the tap behavior will trigger.
@ -37,7 +37,7 @@ For basic usage, please see [mod-tap](./mod-tap.md) and [layer-tap](./layers.md)
### Advanced Configuration ### Advanced Configuration
#### `tapping_term_ms` #### `tapping-term-ms`
Defines how long a key must be pressed to trigger Hold behavior. Defines how long a key must be pressed to trigger Hold behavior.
@ -61,7 +61,7 @@ This example configures a hold-tap that works well for homerow mods:
compatible = "zmk,behavior-hold-tap"; compatible = "zmk,behavior-hold-tap";
label = "HOMEROW_MODS"; label = "HOMEROW_MODS";
#binding-cells = <2>; #binding-cells = <2>;
tapping_term_ms = <150>; tapping-term-ms = <150>;
quick_tap_ms = <0>; quick_tap_ms = <0>;
flavor = "tap-preferred"; flavor = "tap-preferred";
bindings = <&kp>, <&kp>; bindings = <&kp>, <&kp>;
@ -81,7 +81,7 @@ This example configures a hold-tap that works well for homerow mods:
``` ```
If this config does not work for you, try the flavor "balanced" with a medium `tapping_term_ms` such as 200ms. If this config does not work for you, try the flavor "balanced" with a medium `tapping-term-ms` such as 200ms.
#### Comparison to QMK #### Comparison to QMK

View file

@ -34,7 +34,7 @@ You can configure a different tapping term in your keymap:
``` ```
&mt { &mt {
tapping_term_ms = <400>; tapping-term-ms = <400>;
}; };
/ { / {
@ -46,4 +46,4 @@ You can configure a different tapping term in your keymap:
### Additional information ### Additional information
The mod-tap is a [hold-tap](./hold-tap.md) under the hood with the "balanced" flavor and tapping_term_ms 200. The mod-tap is a [hold-tap](./hold-tap.md) under the hood with the "balanced" flavor and tapping-term-ms 200.