fix: hold key continuously at 100% duty keyboard mode (#191)#202
Open
wydvoy wants to merge 3 commits into
Open
fix: hold key continuously at 100% duty keyboard mode (#191)#202wydvoy wants to merge 3 commits into
wydvoy wants to merge 3 commits into
Conversation
added 3 commits
May 20, 2026 10:45
At 100% duty in single-keyboard mode, the engine was emitting KEYDOWN/KEYUP pairs per cycle instead of holding the key down. Switch this path to a true Win32 hold: one initial WM_KEYDOWN (plus Shift for uppercase), repeated WM_KEYDOWN events per cycle, and a single WM_KEYUP on stop. KeyboardHold owns the release so panic/early-return paths still let the key go.
Owner
|
I don't quite see the point here personally. reducing your click speed to once a day will just hold the key down for an entire day and you will have the same effect as what you are trying to accomplish, no? @wydvoy |
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.
Summary
Fixes #191. At 100% Click Duration in single-keyboard mode the engine was sending a KEYDOWN/KEYUP pair per cycle, which target apps see as a rapid tap rather than a held key. This PR rewires that path to a true Win32 hold:
WM_KEYDOWN(with Shift held first if uppercase is on)WM_KEYDOWNevents per cycle — matches the Windows auto-repeat shape (keyboard input docs)WM_KEYUPon stopThe new
KeyboardHoldguard owns the release, so panic/early-return paths still let the key go viaDrop.The gate is intentionally narrow — input_type=keyboard, key_code set, double-click disabled, duty >= 100%. Anything else keeps the existing per-cycle behavior.
Changes
src-tauri/src/engine/keyboard.rs— addKeyboardHold(idempotentrelease+Drop) andhold_keyhelpersrc-tauri/src/engine/worker.rs— detect the 100% keyboard-hold case, take/release the hold across batches, count repeats correctly so click_count stays consistentTest plan
cargo test— 39 passed (4 new keyboard-hold tests)cargo fmt --checkcargo clippy --all-targets -- -D warningsnpm run lintnpm run frontend:build