Skip to content

Windows & Linux AltGr Fix#1538

Merged
goosewobbler merged 38 commits intodevelopfrom
sam/eng-276-fix-altgr-on-windows
May 4, 2023
Merged

Windows & Linux AltGr Fix#1538
goosewobbler merged 38 commits intodevelopfrom
sam/eng-276-fix-altgr-on-windows

Conversation

@goosewobbler
Copy link
Contributor

@goosewobbler goosewobbler commented May 1, 2023

On Windows EN-US 101 key layout the right Alt key (AltGr on UK keyboards) works the same as the left Alt key. For EN-GB and all other layouts it registers as Control + Alt.

We can fix the above behaviour on non-US key layouts; when either the Alt or AltGr modifier is used:

  • the globalShortcut of Control + Alt + {shortcutKey} should be registered, which will ensure that the right alt key works
  • the globalShortcut of Alt + {shortcutKey} should be registered, which will ensure that the left alt key also works

This is also an issue on Linux, the solution there is to register the (undocumented) accelerator AltRight (instead of Control + Alt above)

The KeyboardLayoutMap can be used to determine if the EN-US layout is being used, as it is the only layout where Backslash maps to \.

https://www.w3.org/TR/uievents-code/#keyboard-101
Related Electron issue: electron/electron#13895

@goosewobbler goosewobbler added the WIP PRs that are still in progress and not ready for review or merging label May 1, 2023
@goosewobbler goosewobbler changed the title Windows AltGr Fix Windows & Linux AltGr Fix May 2, 2023
@goosewobbler goosewobbler added WIP PRs that are still in progress and not ready for review or merging and removed WIP PRs that are still in progress and not ready for review or merging labels May 2, 2023
@goosewobbler goosewobbler added WIP PRs that are still in progress and not ready for review or merging and removed WIP PRs that are still in progress and not ready for review or merging labels May 2, 2023
@goosewobbler goosewobbler removed the WIP PRs that are still in progress and not ready for review or merging label May 2, 2023
@goosewobbler goosewobbler added the WIP PRs that are still in progress and not ready for review or merging label May 3, 2023
@goosewobbler goosewobbler removed the WIP PRs that are still in progress and not ready for review or merging label May 4, 2023
@goosewobbler goosewobbler requested a review from mholtzman May 4, 2023 12:48
@goosewobbler goosewobbler merged commit b9891f3 into develop May 4, 2023
@goosewobbler goosewobbler deleted the sam/eng-276-fix-altgr-on-windows branch May 4, 2023 19:31
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