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 shifted keys leaking modifiers #136

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

senekor
Copy link

@senekor senekor commented Aug 18, 2024

closes #135

@senekor
Copy link
Author

senekor commented Aug 18, 2024

This is A PoC to discuss the general approach.

  1. Shifted keys are not transformed into MultipleKeyCodes, but rather a ModifiedKeyCode. If this should be the default behavior going forward, the layout macro still needs to be adjusted accordingly.
  2. State::keycode only reports the key code without any modifiers, preventing them from being associated with other key presses.
  3. Layout::keycodes checks it the last state is a ModifiedKey, in which case the modifiers are added to the list. This ensures the modifiers are only sent if the modified key (e.g. &, +) was the most recently pressed key.

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.

Shifted keys leak modifiers
1 participant