Skip to content

Add macOS left Alt to Command mapping option#5064

Open
bdjben wants to merge 1 commit intoLizardByte:masterfrom
bdjben:macos-left-alt-command
Open

Add macOS left Alt to Command mapping option#5064
bdjben wants to merge 1 commit intoLizardByte:masterfrom
bdjben:macos-left-alt-command

Conversation

@bdjben
Copy link
Copy Markdown

@bdjben bdjben commented Apr 30, 2026

Description

This adds an opt-in macOS input setting, key_leftalt_to_key_cmd, that maps Moonlight's Left Alt key (VKEY_LMENU) to the left macOS Command key.

The mapping happens in the macOS platform key translation layer rather than through keybindings. This matters because keybindings = [0xA4, 0x5B] remaps the key before Sunshine updates its internal modifier state; later key packets that still carry the Alt modifier can then cause Sunshine to synthesize Option in addition to Command. By leaving the core keycode as VKEY_LMENU and only changing the macOS virtual key emitted to CoreGraphics, Sunshine continues to track Alt internally while macOS receives Command.

This is useful for macOS hosts accessed from clients or operating systems that intercept the Windows key before Moonlight can send it, but can still send Left Alt.

Changes

  • Adds key_leftalt_to_key_cmd, default disabled.
  • Applies the remap only in src/platform/macos/input.cpp.
  • Adds the option to the web UI for macOS hosts.
  • Updates configuration docs and English locale strings.

Testing

  • git diff --check
  • jq empty on updated English locale JSON files
  • npm install --no-package-lock --no-audit --no-fund
  • npm run build

@sonarqubecloud
Copy link
Copy Markdown

@ReenigneArcher
Copy link
Copy Markdown
Member

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