Use Command key instead of Control as modifier on macOS

This provides an experience closer to the original classic Mac version.

This is supported by the earlier changes to gracefully quit the game.
This commit is contained in:
Phil Marell
2021-07-24 16:27:34 +10:00
parent c3eb23af4b
commit e098370249
3 changed files with 19 additions and 3 deletions

View File

@@ -1637,11 +1637,19 @@ static bool IdentifyVKey(const SDL_KeyboardEvent *keyEvt, GpKeyIDSubset_t &outSu
return false;
}
break;
#ifdef __MACOS__
case SDLK_LGUI:
#else
case SDLK_LCTRL:
#endif
outSubset = GpKeyIDSubsets::kSpecial;
outKey.m_specialKey = GpKeySpecials::kLeftCtrl;
break;
#ifdef __MACOS__
case SDLK_RGUI:
#else
case SDLK_RCTRL:
#endif
outSubset = GpKeyIDSubsets::kSpecial;
outKey.m_specialKey = GpKeySpecials::kRightCtrl;
break;

View File

@@ -97,8 +97,8 @@ namespace GpKeySpecials
kEnter,
kLeftShift,
kRightShift,
kLeftCtrl,
kRightCtrl,
kLeftCtrl, // Maps to Command modifier on macOS.
kRightCtrl, //
kLeftAlt,
kRightAlt,
kNumLock,

View File

@@ -1405,14 +1405,22 @@ namespace PortabilityLayer
size_t MenuManagerImpl::FormatHintText(uint8_t *buffer, uint8_t key)
{
#ifdef __MACOS__
buffer[0] = 'C';
buffer[1] = 'm';
buffer[2] = 'd';
buffer[3] = '+';
buffer[4] = key;
return 5;
#else
buffer[0] = 'C';
buffer[1] = 't';
buffer[2] = 'r';
buffer[3] = 'l';
buffer[4] = '+';
buffer[5] = key;
return 6;
#endif
}
MenuManagerImpl *MenuManagerImpl::GetInstance()