1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

fix keyboard state access

* is somewhat playable already!
This commit is contained in:
AlexVinS
2014-05-21 23:14:05 +04:00
committed by AlexVinS
parent cd81e85a61
commit 6890c2650b
3 changed files with 34 additions and 9 deletions

View File

@ -1378,12 +1378,12 @@ bool CPlayerInterface::moveHero( const CGHeroInstance *h, CGPath path )
bool CPlayerInterface::shiftPressed() const
{
return SDL_GetKeyState(nullptr)[SDLK_LSHIFT] || SDL_GetKeyState(nullptr)[SDLK_RSHIFT];
return isShiftKeyDown();
}
bool CPlayerInterface::altPressed() const
{
return SDL_GetKeyState(nullptr)[SDLK_LALT] || SDL_GetKeyState(nullptr)[SDLK_RALT];
return isAltKeyDown();
}
void CPlayerInterface::showGarrisonDialog( const CArmedInstance *up, const CGHeroInstance *down, bool removableUnits, QueryID queryID)
@ -1595,7 +1595,7 @@ void CPlayerInterface::objectRemoved( const CGObjectInstance *obj )
bool CPlayerInterface::ctrlPressed() const
{
return SDL_GetKeyState(nullptr)[SDLK_LCTRL] || SDL_GetKeyState(nullptr)[SDLK_RCTRL];
return isCtrlKeyDown();
}
void CPlayerInterface::update()