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 UK Hash and Backslash mixup #27

Merged
merged 6 commits into from
Feb 6, 2023

Conversation

thejpster
Copy link
Member

Closes #25

Copy link
Member

@ryan-summers ryan-summers left a comment

Choose a reason for hiding this comment

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

Minor doc request, otherwise looks good to me :) Also needs CHANGELOG entry

src/layouts/uk105.rs Outdated Show resolved Hide resolved
@thejpster
Copy link
Member Author

Rather than explain why HashTilde and Backslash are swapped on a UK keyboard, I got a bit carried away and fundamentally reworked how we name Key Codes.

Now matches https://kbdlayout.info/kbduk/virtualkeys. Also fixes decode of Print Screen and Pause/Break.

* BackTick is now Oem8
* Minus is now OemMinus
* Equals is now OemPlus
* BracketSquareLeft is now Oem4
* BracketSquareRight is now Oem6
* BackSlash is now Oem7
* SemiColon is now Oem1
* Quote is now Oem3
* Enter is now Return
* Comma is now OemComma
* Fullstop is now OemPeriod
* Slash is now Oem2
* NumpadSlash is now NumpadDivide
* NumpadStar is now NumpadMultiply
* NumpadMinus is now NumpadSubtract
* NumpadPlus is now NumpadAdd
* ShiftLeft/Right is now LShift/RShift
* ControlLeft/Right is now LControl/RControl
* AltLeft/Right is now LAlt/RAltGr
* RCtrl2 is now a thing (turns NumLock into Pause)
* RAlt2 is now a thing (sent as part of Print Screen)
* Cleaned up the test cases

The KeyCode enum now fits in a `u8`.
It makes KeyCodes non-FFI-safe.
Copy link
Member

@ryan-summers ryan-summers left a comment

Choose a reason for hiding this comment

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

I like the changes, but the Oem codes are a bit opaque to me. Which makes sense if every OEM uses them differently.

In any case, I like the changes here. I haven't thoroughly reviewed every key mapping, but I imagine it's easy for us to fix issues as they arise.

@thejpster thejpster merged commit 549d49e into rust-embedded-community:main Feb 6, 2023
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.

UK ScanCodeSet 2 errors
3 participants