tap-hold pending_output (speculative Hold) - #709
Merged
Conversation
Add a defaulted trait method System::pending_output(&PKS) -> Option<KeyOutput> so Keymap's HID fold can include speculative output without special-casing tap-hold in keymap.rs. The fold now includes pending_output in pressed_keys and aggregate_pressed_modifiers while a pending session is live, using iterator chain rather than a mutating push. This is the generic seam for tap-hold Hold-while-undecided; other families keep the default None (no output while pending). Model: grok-4.6 Agent: Grok Build Co-Authored-By: Grok 4.6 <grok-4.6@x.ai> Co-Authored-By: Grok Build <grok-build@x.ai>
Add PendingOutput (NoOutput|Hold) to Profile, store baked HID on Key.hold_output, and copy it into PendingKeyState when pending_output is Hold. tap_hold::System::pending_output returns that stored KeyOutput; it never inspects composite Ref. Nickel fills hold_output from the hold keyboard leaf (non-keyboard and LeftGUI/RightGUI stay None). Model: grok-4.6 Agent: Grok Build Co-Authored-By: Grok 4.6 <grok-4.6@x.ai> Co-Authored-By: Grok Build <grok-build@x.ai>
Add pending_output (NoOutput|Hold) to tap-hold Profile/Config, lower flat config.tap_hold.pending_output to default_profile, and bake hold_output on tap-hold Key data from the hold keyboard leaf. LeftGUI/RightGUI and non-keyboard holds are omitted. Composite System::pending_output delegates to each pending family's System::pending_output; it does not match on aggregate Ref. Model: grok-4.6 Agent: Grok Build Co-Authored-By: Grok 4.6 <grok-4.6@x.ai> Co-Authored-By: Grok Build <grok-build@x.ai>
Generated via ncl/scripts/save-test-snapshots.sh after adding System::pending_output and baking Key.hold_output in tap-hold codegen. Model: grok-4.6 Agent: Grok Build Co-Authored-By: Grok 4.6 <grok-4.6@x.ai> Co-Authored-By: Grok Build <grok-build@x.ai>
Add tests/rust/tap_hold/pending_output.rs with 7 AAA tests: default silent, default timeout hold, Hold+first-tick, Hold+timeout, Hold+quick-release cancel, Hold+HoldOnKeyPress interrupt, and GUI refusal. AAA prose is inside each test body. Register the module from tests/rust/tap_hold.rs. Model: grok-4.6 Agent: Grok Build Co-Authored-By: Grok 4.6 <grok-4.6@x.ai> Co-Authored-By: Grok Build <grok-build@x.ai>
Add features/keymap/key/tap_hold-config-pending_output.feature with 3 scenarios (Hold+timeout, Hold+quick-release retracts to tap, Hold+HoldOnKeyPress). Default Hold is in Background; default silent is covered in rust integration test. Prose uses NoOutput, no emdash, semantic linebreaks, and matches FAK eager_decision, ZMK hold-while-undecided, and QMK Speculative Hold. Model: grok-4.6 Agent: Grok Build Co-Authored-By: Grok 4.6 <grok-4.6@x.ai> Co-Authored-By: Grok Build <grok-build@x.ai>
rgoulter
force-pushed
the
pending-output-opaque-ref
branch
from
August 29, 2026 12:38
8acd355 to
7e19795
Compare
rgoulter
commented
Aug 29, 2026
Comment on lines
+215
to
+222
| 224 => 1, | ||
| 225 => 2, | ||
| 226 => 4, | ||
| 227 => 8, | ||
| 228 => 16, | ||
| 229 => 32, | ||
| 230 => 64, | ||
| 231 => 128, |
Owner
Author
There was a problem hiding this comment.
Let's use hex values, or otherwise comment this so it's clearer / easier to cross reference.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rewrite of #708: speculative eager Hold for tap-hold (FAK
eager_decision='hold'/ ZMKhold-while-undecided/ QMK Speculative Hold) behind a genericSystem::pending_outputseam.Refstays opaque. Guarding of what can be speculated is done in Nickel (keymap codegen), not by pattern-matching compositeRefin Rust.Approach
System::pending_output(&PendingKeyState) -> Option<KeyOutput>is the keymap HID fold point (pressed_keys/aggregate_pressed_modifiers).keymap.rsstays generic.tap_hold::Key.hold_outputfrom the hold keyboard leaf. LeftGUI / RightGUI and non-keyboard holds are omitted.tap_hold::System::pending_outputreturns that storedKeyOutputwhenProfile.pending_outputisHold.System::pending_outputdelegates to the pending family's method (self.tap_hold.pending_output(pks)). It does not match onRef.Stack
PendingOutput(NoOutput|Hold),Key.hold_output: Option<KeyOutput>,PendingKeyStatecopies that HID when the profile isHold.config.tap_hold.pending_outputauthoring/lowering; bakehold_output; composite delegatespending_output.ncl/scripts/save-test-snapshots.sh.tests/rust/tap_hold/pending_output.rs(default silent, default timeout hold, Hold+first-tick, Hold+timeout, Hold+quick-release cancel, Hold+HoldOnKeyPress interrupt, GUI refusal).tap_hold-config-pending_output.feature(3 scenarios; default Hold in Background).Verification
cargo test --test rust-integration pending_output7 passedjust test-fast220 passedjust ncl::snapshotsgreenjust check-quickfmt/clippy/doc greenLinger / same-mod ZMK tap deferred to follow-on.
Supersedes #708.