Closed codeman38 closed 1 year ago
I've personally tested this change on an M1 MacBook running macOS 13, and can confirm that it interprets key definitions from the config and writes updated key mappings to the config correctly now when it hadn't done so before.
Merged (apologies for the late reply).
Thanks for this, really appreciated.
Mednaffe compiles and runs surprisingly well out of the box on macOS with one notable exception: the key codes returned in hardware_keycode by GDK on macOS are really weird compared to those used on other Unix-based OSes, due to maintaining compatibility with standards used by older macOS versions. This causes the key definition dialogues to behave very unexpectedly on that OS.
These key definitions are conveniently specified in Events.h in Carbon.framework - with the exception of the Windows application key, which doesn't exist on Mac keyboards, but which returns a code of 110 in GDK when I tested it manually. Additionally, Mac F13-F15 correspond to the Print Screen, Scroll Lock, and Pause keys on Windows, so I mapped those accordingly as well.
The
__APPLE__
preprocessor directive identifies whether we're compiling on macOS, so I added these in an additional#ifdef
block under the existing one for__G_OS_UNIX__
with these Mac-specific definitions.