Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix key pressed before combo making combo wait for timeout #531

Merged
merged 4 commits into from
Jul 24, 2022
Merged

Fix key pressed before combo making combo wait for timeout #531

merged 4 commits into from
Jul 24, 2022

Conversation

Jawfish
Copy link
Contributor

@Jawfish Jawfish commented Jul 24, 2022

Fix for #528.

Resets combos on key-up if there isn't a current match.

Added 4 new tests for this case, too, with different delays in key press/release and checking that it works whether the other key is a combo key or "inert".

I also added some type hints to help me with debugging and left them in, hope that's alright since it'll need to be done anyway for #205.

Comment on lines +230 to +231
if not self._matching:
self.reset(keyboard)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This obviously only resets if no combos are matching, and doesn't reset non-matching combos if there're potential matches left. I'm not 100% sure that's perfect, but it's at least a step foward.

kmk/modules/combos.py Outdated Show resolved Hide resolved
kmk/modules/combos.py Show resolved Hide resolved
@xs5871
Copy link
Collaborator

xs5871 commented Jul 24, 2022

Thanks!

@xs5871 xs5871 merged commit 637991c into KMKfw:master Jul 24, 2022
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.

2 participants