wxBackend: AltGr (Right Alt) character input on macOS and Linux#3384
Open
stpork wants to merge 3 commits into
Open
wxBackend: AltGr (Right Alt) character input on macOS and Linux#3384stpork wants to merge 3 commits into
stpork wants to merge 3 commits into
Conversation
Adds a "Use Right Alt as AltGr" toggle in System Settings -> Input settings. Default off preserves existing Right-Alt-as-Alt-modifier behavior. When on, Right Alt produces the keyboard layout's AltGr glyphs (e.g. R-Alt+2 = '@' on Finnish/Swedish layouts). Engages composing mode in KeyTracker on Right Alt (raw kVK_RightOption on Mac; ISO_Level3_Shift / XF86 ALTGR on X11/Wayland). In OnKeyDown, printable keys are routed to OnChar so the layout can translate; in OnChar, the Alt (and on Linux also Ctrl, synthesized by X11 from AltGr) modifier bits are stripped so far2l types the character instead of firing an Alt+key binding. Non-printable keys keep Alt+key behavior. Setting is plumbed through Opt.UseRightAltAsAltGr and the existing ConfigOpt machinery; the runtime flag lives in WinPort (APIOther.cpp) with default-visibility exports so the dynamically-loaded backend resolves the symbol against the bundle_loader executable.
akruphi
reviewed
May 8, 2026
| int NoBoxes; | ||
| int ConsolePaintSharp, ExclusiveCtrlLeft, ExclusiveCtrlRight, ExclusiveAltLeft, ExclusiveAltRight, | ||
| ExclusiveWinLeft, ExclusiveWinRight; | ||
| int UseRightAltAsAltGr; |
Contributor
There was a problem hiding this comment.
May be use type bool: bool UseRightAltAsAltGr;?
Contributor
Author
There was a problem hiding this comment.
i kept int to match AddCheckbox(..., BOOL Value) and the ConfigOpt table, which registers all the neighbours as int*. Happy to switch to bool if you'd prefer.
akruphi
reviewed
May 8, 2026
| } | ||
| ApplyConsoleTweaks(); | ||
| XlatReinit(); | ||
| WinPortSetUseRightAltAsAltGr(Opt.UseRightAltAsAltGr ? TRUE : FALSE); |
Contributor
There was a problem hiding this comment.
if type Opt.UseRightAltAsAltGr change to bool here we can use variable without conditional operator.
Contributor
Author
There was a problem hiding this comment.
happy to switch this and previous to bool if you'd prefer — just say the word.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a "Use Right Alt as AltGr" toggle in System Settings -> Input settings. Default off preserves existing Right-Alt-as-Alt-modifier behavior. When on, Right Alt produces the keyboard layout's AltGr glyphs (e.g. R-Alt+2 = '@' on Finnish/Swedish layouts).
Engages composing mode in KeyTracker on Right Alt (raw kVK_RightOption on Mac; ISO_Level3_Shift / XF86 ALTGR on X11/Wayland). In OnKeyDown, printable keys are routed to OnChar so the layout can translate; in OnChar, the Alt (and on Linux also Ctrl, synthesized by X11 from AltGr) modifier bits are stripped so far2l types the character instead of firing an Alt+key binding. Non-printable keys keep Alt+key behavior.
Setting is plumbed through Opt.UseRightAltAsAltGr and the existing ConfigOpt machinery; the runtime flag lives in WinPort (APIOther.cpp) with default-visibility exports so the dynamically-loaded backend resolves the symbol against the bundle_loader executable.
Bugs:
@, to print it you need to press AltGr + 2) #832, AltGr characters does not work #940, Alt-Gr keystrokes does not work (Linux) #3089, Add macro support for AltGr or/and Right Alt + Key combos #1671