Skip to content

Commit 280fe44

Browse files
tompassarelliclaude
andcommitted
tap-hold-release-order: add tap-repress-timeout parameter
Allows double-tap-and-hold to bypass hold-tap logic and repeat the tap action. Syntax is now: (tap-hold-release-order <tap-repress-timeout> <buffer-ms> <tap> <hold>) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ced3c92 commit 280fe44

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

parser/src/cfg/tap_hold.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,23 +98,24 @@ pub(crate) fn parse_tap_hold_release_order(
9898
ac_params: &[SExpr],
9999
s: &ParserState,
100100
) -> Result<&'static KanataAction> {
101-
if ac_params.len() != 3 {
101+
if ac_params.len() != 4 {
102102
bail!(
103-
r"tap-hold-release-order expects 3 items after it, got {}.
103+
r"tap-hold-release-order expects 4 items after it, got {}.
104104
Params in order:
105-
<buffer-ms> <tap-action> <hold-action>",
105+
<tap-repress-timeout> <buffer-ms> <tap-action> <hold-action>",
106106
ac_params.len(),
107107
)
108108
}
109-
let buffer = parse_u16(&ac_params[0], s, "buffer")?;
110-
let tap_action = parse_action(&ac_params[1], s)?;
111-
let hold_action = parse_action(&ac_params[2], s)?;
109+
let tap_repress_timeout = parse_u16(&ac_params[0], s, "tap repress timeout")?;
110+
let buffer = parse_u16(&ac_params[1], s, "buffer")?;
111+
let tap_action = parse_action(&ac_params[2], s)?;
112+
let hold_action = parse_action(&ac_params[3], s)?;
112113
if matches!(tap_action, Action::HoldTap { .. }) {
113114
bail!("tap-hold does not work in the tap-action of tap-hold")
114115
}
115116
Ok(s.a.sref(Action::HoldTap(s.a.sref(HoldTapAction {
116117
config: HoldTapConfig::ReleaseOrder { buffer },
117-
tap_hold_interval: 0,
118+
tap_hold_interval: tap_repress_timeout,
118119
timeout: u16::MAX,
119120
tap: *tap_action,
120121
hold: *hold_action,

0 commit comments

Comments
 (0)