Skip to content

Windows menus show Alt before Ctrl in accelerators ("Alt+Ctrl+G") #56065

Backlog

Description

@johansan

Preflight Checklist

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.

The gist's Shortcuts menu on Electron 44.5.1: Alt+Ctrl+G and Alt+Ctrl+Shift+G

Testcase Gist URL

https://gist.github.com/johansan/8d753f41ac86a555e37a19b7a63b393b

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));
  }
#endif

On 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

  1. added
    has-repro-gist
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    44-x-ybug 🪲has-repro-gistplatform/windows

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions