Skip to content

Fix hold_keys dropping duplicate keys in + syntax (#1347) - #1351

Open
arturomaciaas wants to merge 1 commit into
sezanzeb:mainfrom
arturomaciaas:fix/hold-keys-duplicate-symbols
Open

Fix hold_keys dropping duplicate keys in + syntax (#1347)#1351
arturomaciaas wants to merge 1 commit into
sezanzeb:mainfrom
arturomaciaas:fix/hold-keys-duplicate-symbols

Conversation

@arturomaciaas

Copy link
Copy Markdown

Fixes #1347

Problem
When using the + syntax with repeated keys (e.g., KEY_4+KEY_3+KEY_5+KEY_5+KEY_9), duplicate keys were silently dropped because pressing an already-held key is a no-op at the kernel level.

Solution
The fix releases a key before re-pressing it when a duplicate is encountered in hold_keys, so that sequences like KEY_5+KEY_5 properly output both keystrokes.

What was changed

  • inputremapper/injection/macros/tasks/hold_keys.py — track held codes and release before re-pressing duplicates; release each unique code once on trigger release
  • tests/unit/test_macros/test_hold_keys.py — added tests for duplicate keys in both hold_keys() and + syntax

Before: KEY_4+KEY_3+KEY_5+KEY_5+KEY_9+KEY_4+KEY_1+KEY_2+KEY_8+KEY_5 = 4359128
After: KEY_4+KEY_3+KEY_5+KEY_5+KEY_9+KEY_4+KEY_1+KEY_2+KEY_8+KEY_5 = 4355941285

@arturomaciaas
arturomaciaas force-pushed the fix/hold-keys-duplicate-symbols branch from 3b6b926 to b833c80 Compare August 26, 2026 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KEY_3+KEY_3 outputs 3. not 33. No double numbers allowed? 😳

1 participant