action map remap for mac

Mac now automatically remaps keys and modifies the incoming string to reflect it

automatically converts:
Ctrl -> Cmd
Alt -> Option

if you absolutely need a specific set on macos you will still need to check the platform in script and set the required key otherwise this will allow menus to be built with just providing the windows key or the mac key and it will display correclty for the platform.
This commit is contained in:
marauder2k7 2026-03-13 21:59:46 +00:00
parent 8de2458610
commit 496895d60c
3 changed files with 89 additions and 27 deletions

View file

@ -77,6 +77,14 @@ void Input::init()
smLastJoystickActivated = true;
SDL_InitSubSystem( SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER | SDL_INIT_EVENTS );
#ifdef TORQUE_OS_MAC
// Disable Ctrl+Click being treated as right-click
SDL_SetHint(SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK, "0");
// Optionally, handle function keys as standard F1F12
SDL_SetHint(SDL_HINT_MAC_BACKGROUND_APP, "0");
#endif
// Init the current modifier keys
setModifierKeys(0);