Skip to content

Show keyboard shortcuts in app menus #418

Closed

Description

@M4n0x

Problem

The menus that App menus and the Apple menu open in StableBar's popup list items, separators, checkmarks and submenus, but no keyboard shortcuts. The macOS menu bar shows each item's shortcut on the right, so people who replace it with StableBar lose the place where they look shortcuts up. The guide names the gap ("These menus show items, separators, checkmarks and submenus, but not keyboard shortcuts", docs/widgets.md), and #291 listed it as a known gap.

Proposal

  • Read each item's shortcut through Accessibility, which gives it for AppKit, Chromium, Electron and JetBrains apps alike: AXMenuItemCmdChar, AXMenuItemCmdVirtualKey, AXMenuItemCmdGlyph and AXMenuItemCmdModifiers.
  • Show it on the right of the row, dimmed, as macOS does: ⌃⌥⇧⌘ then the key, with symbols for keys without a character (↩ ⌫ ⌦ ⎋ ⇥, arrows, Page Up/Down, Home/End), F-keys by name, and 🌐 for fn shortcuts such as Window → Fill (🌐⌃F). Keys line up in one column, and a long title is cut short before its shortcut. The popup keeps its 260 pt width.
  • Read an item's attributes in one AXUIElementCopyMultipleAttributeValues call, so the four extra attributes don't slow menus down.
  • Menus opened from the Menu bar items widget share the reader, so they get shortcuts too.

What Accessibility returns (macOS 27.2, read from Finder, Terminal, Chrome, Slack, Spotify, Ghostty and PhpStorm):

  • AXMenuItemCmdModifiers: 0 is ⌘ alone, then 1 adds ⇧, 2 adds ⌥, 4 adds ⌃, 8 removes ⌘, and 16, which the headers don't name, adds fn. Finder's Window → Fill is 28 (🌐⌃F), View → Enter Full Screen is 24 (🌐F).
  • Keys without a character come with a virtual key code and usually a glyph, and their AXMenuItemCmdChar is a control or private-use character (U+0008 for ⌫, U+F700 for ↑) that can't be shown as is. Finder's Window → Move & Resize items give only the virtual key code.
  • Dictation's shortcut is glyph 150 with 🎤 as its character.
  • Timing for Chrome's File menu, 16 items: today's four reads per item take 16–18 ms; adding the four shortcut attributes as separate reads takes 37 ms; all eight in one call take 13 ms.

Possible today

No. AppMenu.entries(of:) reads the title, enabled state, checkmark and submenu, and AppMenuRow draws only those.

Related

Triaged by Claude Code (Claude Opus 5.5).

Activity

  1. added
    enhancement
    on Nov 3, 2026
  2. stablebar-releases commented on Nov 6, 2026

    @stablebar-releases

    🎉 This issue has been resolved in version 0.11.0 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

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

    enhancementreleased

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions