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(behaviors): allow saving sticky keys with the same position #1610

Conversation

nguyendown
Copy link
Contributor

When a sticky key is pressed, a duplicated sticky key will be searched for and released. However, currently only position is used to search for a sticky key, which causes issues because keys with different layers may have the same position.

Adding checks on both position and layer is not enough because key events generated by macro have the same position and layer.
7a4f3a2

I have been considering that two sticky keys &sk LEFT_SHIFT at different positions should be treated as the same sticky key. The use of position or layer is not necessary because param1 has keycode, usage page, and mods, which are sufficient to identify sticky keys.

Fix #1421

urob and others added 2 commits December 23, 2022 19:53
Previously, `position` was used to search for a sticky key, but it was
not sufficient because keys with different layers or generated by
macros could have the same position. This caused issues when saving
keys with the same position, as only one could be saved at a time.
Adding checks on `param1`, `position`, and `layer` resolves the issue,
but `param1` alone is sufficient to identify sticky keys.
@petejohanson
Copy link
Contributor

This... Seems like a fairly reasonable fix for this. Let me consider if there's any potential downsides to this approach.

@okke-formsma any concerns?

@petejohanson petejohanson self-assigned this Jan 6, 2023
@petejohanson petejohanson added behaviors enhancement New feature or request labels Jan 6, 2023
@nguyendown nguyendown marked this pull request as draft July 2, 2023 05:17
@caksoylar
Copy link
Contributor

I forgot that this PR existed when I developed #2758, sorry! I just realized it after seeing it linked on #1421. The addressed issue should be fixed by the former now.

@caksoylar caksoylar closed this Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
behaviors enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: ignore-modifiers ignored in macro
4 participants