Repository navigation
Description
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker: Menu - Keybinding with Ctrl & Alt on Windows reads as Alt+Ctrl #1547 (2015) reported this and was closed as Chrome's to fix. Electron's own
accelerator.patchnow edits the function that writes this order, so it can be fixed in Electron.
Electron Version
44.5.1
What operating system(s) are you using?
Windows
Operating System Version
Windows 11 26H2 (build 26300.9711)
What arch are you using?
x64
Last Known Working Electron version
None known
Does the issue also appear in Chromium / Google Chrome?
I don't know how to test
Expected Behavior
A menu item with accelerator: 'Control+Alt+G' shows "Ctrl+Alt+G". Office writes Ctrl before Alt (PowerPoint's Paste Special: Ctrl+Alt+V), and so do .NET's WinForms KeysConverter and WPF's KeyGesture, which both give "Ctrl+Alt+Shift+A" for Control+Alt+Shift+A.
Actual Behavior
The menu shows "Alt+Ctrl+G", and Control+Alt+Shift+G shows "Alt+Ctrl+Shift+G". Control+Shift+G shows "Ctrl+Shift+G" as expected.
An app that also lists its shortcuts outside the menu, such as on a shortcuts page, shows the same shortcut in two orders.
Testcase Gist URL
Additional Information
Steps: run the gist on Windows and open the Shortcuts menu.
I found no item in Chrome's own menus with both Ctrl and Alt to compare.
In-depth investigation
The text comes from Chromium's Accelerator::GetLongFormModifiers (ui/base/accelerators/accelerator.cc), which adds the modifiers in a fixed order, Alt before Ctrl, on every platform but macOS:
if (IsAltDown()) {
modifiers.push_back(l10n_util::GetStringUTF16(IDS_APP_ALT_KEY));
}
if (IsCtrlDown()) {
modifiers.push_back(l10n_util::GetStringUTF16(IDS_APP_CTRL_KEY));
}The function is the same in Chromium 152.0.7977.130 (Electron 44.5.1) and 160.0.8181.0 (main). Electron's patches/chromium/accelerator.patch already edits this function. A fix there (untested; I haven't built Electron) could add Alt after Ctrl on Windows only:
#if !BUILDFLAG(IS_WIN)
if (IsAltDown()) {
modifiers.push_back(l10n_util::GetStringUTF16(IDS_APP_ALT_KEY));
}
#endif
if (IsCtrlDown()) {
modifiers.push_back(l10n_util::GetStringUTF16(IDS_APP_CTRL_KEY));
}
#if BUILDFLAG(IS_WIN)
if (IsAltDown()) {
modifiers.push_back(l10n_util::GetStringUTF16(IDS_APP_ALT_KEY));
}
#endifOn stock 44.5.1, menu._getAcceleratorTextAt() returns "Alt+Ctrl+A" for Alt+Control+A and "Alt+Ctrl+Shift+A" for Shift+Alt+Control+A.

Activity