Index: binaries/data/mods/public/gui/credits/texts/programming.json =================================================================== --- binaries/data/mods/public/gui/credits/texts/programming.json +++ binaries/data/mods/public/gui/credits/texts/programming.json @@ -231,6 +231,7 @@ { "nick": "sathyam", "name": "Sathyam Vellal" }, { "nick": "sbirmi", "name": "Sharad Birmiwal" }, { "nick": "sbte", "name": "Sven Baars" }, + { "nick": "Schweini", "name": "Laurenz Reinthaler"}, { "nick": "scroogie", "name": "André Gemünd" }, { "nick": "scythetwirler", "name": "Casey X." }, { "nick": "serveurix" }, Index: binaries/data/mods/public/gui/options/options.json =================================================================== --- binaries/data/mods/public/gui/options/options.json +++ binaries/data/mods/public/gui/options/options.json @@ -84,6 +84,11 @@ "tooltip": "Show only generic names for units." } ] + }, + { + "type": "boolean", + "label": "Mac Mouse", + "tooltip": "Enables right-clicking with Ctrl+Click on Mac. WARNING: Actions that used Ctrl+Click before (e.g. garrison) will be changed to CMD+Click. Furthermore the risk of accidentally quitting the game with CMD+Q gets higher! (Restart Required)" } ] }, Index: source/ps/GameSetup/GameSetup.cpp =================================================================== --- source/ps/GameSetup/GameSetup.cpp +++ source/ps/GameSetup/GameSetup.cpp @@ -645,6 +645,7 @@ bool macMouse = false; CFG_GET_VAL("macmouse", macMouse); SDL_SetHint(SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK, macMouse ? "1" : "0"); + UseMacOSXHotkeys(macMouse); #endif } Index: source/ps/Hotkey.h =================================================================== --- source/ps/Hotkey.h +++ source/ps/Hotkey.h @@ -111,4 +111,11 @@ */ extern bool HotkeyIsPressed(const CStr& keyname); +/** + * On OSX machines a right click can only be executed trough Ctrl+Click without using a mouse. + * All hotkeys that only use Ctrl are changed to Super (CMD). + */ +extern void UseMacOSXHotkeys(bool boolean); + + #endif // INCLUDED_HOTKEY Index: source/ps/Hotkey.cpp =================================================================== --- source/ps/Hotkey.cpp +++ source/ps/Hotkey.cpp @@ -479,3 +479,15 @@ { return g_HotkeyStatus[keyname]; } + +void UseMacOSXHotkeys(bool boolean) +{ + for (const std::pair& configPair : g_ConfigDB.GetValuesWithPrefix(CFG_COMMAND, "hotkey.")) + { + for (const CStr& hotkey : configPair.second) + { + if (boolean && hotkey == "Ctrl") g_ConfigDB.SetValueString(CFG_COMMAND, configPair.first, "Super"); + else if (!boolean && hotkey == "Super") g_ConfigDB.SetValueString(CFG_COMMAND, configPair.first, "Ctrl"); + } + } +}