mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-12-14 03:59:36 +00:00
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:
@@ -1637,11 +1637,19 @@ static bool IdentifyVKey(const SDL_KeyboardEvent *keyEvt, GpKeyIDSubset_t &outSu
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#ifdef __MACOS__
|
||||||
|
case SDLK_LGUI:
|
||||||
|
#else
|
||||||
case SDLK_LCTRL:
|
case SDLK_LCTRL:
|
||||||
|
#endif
|
||||||
outSubset = GpKeyIDSubsets::kSpecial;
|
outSubset = GpKeyIDSubsets::kSpecial;
|
||||||
outKey.m_specialKey = GpKeySpecials::kLeftCtrl;
|
outKey.m_specialKey = GpKeySpecials::kLeftCtrl;
|
||||||
break;
|
break;
|
||||||
|
#ifdef __MACOS__
|
||||||
|
case SDLK_RGUI:
|
||||||
|
#else
|
||||||
case SDLK_RCTRL:
|
case SDLK_RCTRL:
|
||||||
|
#endif
|
||||||
outSubset = GpKeyIDSubsets::kSpecial;
|
outSubset = GpKeyIDSubsets::kSpecial;
|
||||||
outKey.m_specialKey = GpKeySpecials::kRightCtrl;
|
outKey.m_specialKey = GpKeySpecials::kRightCtrl;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -97,8 +97,8 @@ namespace GpKeySpecials
|
|||||||
kEnter,
|
kEnter,
|
||||||
kLeftShift,
|
kLeftShift,
|
||||||
kRightShift,
|
kRightShift,
|
||||||
kLeftCtrl,
|
kLeftCtrl, // Maps to Command modifier on macOS.
|
||||||
kRightCtrl,
|
kRightCtrl, //
|
||||||
kLeftAlt,
|
kLeftAlt,
|
||||||
kRightAlt,
|
kRightAlt,
|
||||||
kNumLock,
|
kNumLock,
|
||||||
|
|||||||
@@ -1405,14 +1405,22 @@ namespace PortabilityLayer
|
|||||||
|
|
||||||
size_t MenuManagerImpl::FormatHintText(uint8_t *buffer, uint8_t key)
|
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[0] = 'C';
|
||||||
buffer[1] = 't';
|
buffer[1] = 't';
|
||||||
buffer[2] = 'r';
|
buffer[2] = 'r';
|
||||||
buffer[3] = 'l';
|
buffer[3] = 'l';
|
||||||
buffer[4] = '+';
|
buffer[4] = '+';
|
||||||
buffer[5] = key;
|
buffer[5] = key;
|
||||||
|
|
||||||
return 6;
|
return 6;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
MenuManagerImpl *MenuManagerImpl::GetInstance()
|
MenuManagerImpl *MenuManagerImpl::GetInstance()
|
||||||
|
|||||||
Reference in New Issue
Block a user