Opened 5 years ago

Closed 5 years ago

#11364 closed defect (fixed)

GUI: KEYMAPS: Command key incorrectly displayed as ‘Meta’ on MacOS.

Reported by: macca8 Owned by: bgK
Priority: normal Component: GUI
Version: Keywords:
Cc: Game:

Description

Mac keyboards feature the Command key (Cmd), instead of keys displaying the traditional META key name and/or symbol.

The Command key is the default modifier for virtually all macOS shortcuts, so I’m surprised to see the key(s) omitted from the list of Keycodes & Modifier Flags in common/keyboard.h.

Nevertheless, the current mapping of the Command key to the Meta key binding works well enough as far as accessing the key is concerned… providing the binding remains invisible to the user.

Now that users can access the Keymaps, where this breaks down is in NOT displaying the key actually pressed, in this case, the Command key (Cmd).

The issue here is not with the binding, but rather the description included in KBD_META’s definition in the defaultModifiers[] list of keymapper/hardware-input.cpp.

May I suggest that the simplest solution would appear to be to add an alternative KBD_META definition for macOS to the defaultModifiers[] list, assuming it’s legal to do so, for example (formatted appropriately of course):

If defined(MACOSX) then
{KBD_META, “M”, “Cmd+”}
else
{KBD_META, “M”, “Meta+”}
end if

The long term solution is probably to recognise the Command key in its own right, by adding KEYCODE_LCMD & KEYCODE_RCMD as keys, and KBD_CMD as a modifier flag, and making appropriate adjustments to the Keymapper and elsewhere as needed, but that would seem to be overkill for this issue.

Change History (1)

comment:1 by bgK, 5 years ago

Owner: set to bgK
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.