Skip to content

Fix US backslash #46

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

Merged
merged 2 commits into from
Sep 13, 2024
Merged

Fix US backslash #46

merged 2 commits into from
Sep 13, 2024

Conversation

thejpster
Copy link
Member

I incorrectly marked the "backslash" key on the ANSI 101/104 layout as OEM 7 instead of OEM 5. This is because the virtual key names on https://kbdlayout.info change depending on whether you are looking at a UK layout or a US layout. As we map from scancode to enum KeyCode before looking at which layout it is, we have to standardise on the 'UK' mappings.

Now all placed according to their UK layout location, because we map scancode to KeyCode before considering the keyboard layout. Previously I referred to different layouts for ANSI104 and ISO105 and this introduced some errors.

Closes #45
Copy link

@jannic jannic left a comment

Choose a reason for hiding this comment

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

I also had a look at Y/Z on the German keyboard. Looks like there it was already correct: The KeyCodes are arguably wrong (key labeled Z should be KeyCode::Z, but can't as we don't know the lay out yet), but then gets mapped to character y in De105Key.

@thejpster
Copy link
Member Author

If you have a better way of symbolically labelling keycaps without referring to what is written on top of them, I'm all ears! I guess the other option is to refactor pc-keyboard so that scancode mapping is done on a per-layout basis; I'm not just not sure it's worth the effort or the potential increase in code size when multiple layouts are used.

@thejpster thejpster merged commit 42acef2 into main Sep 13, 2024
7 checks passed
@thejpster thejpster deleted the fix-us-backslash branch September 13, 2024 18:27
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.

4 participants