1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-13 01:20:34 +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

@ -732,9 +732,8 @@ void CAdvMapInt::show(SDL_Surface * to)
if((animValHitCount % (4/scrollSpeed)) == 0
&& (
(GH.topInt() == this)
|| SDL_GetKeyState(nullptr)[SDLK_LCTRL]
|| SDL_GetKeyState(nullptr)[SDLK_RCTRL]
)
|| isCtrlKeyDown()
)
)
{
if( (scrollingDir & LEFT) && (position.x>-CGI->mh->frameW) )
@ -1054,7 +1053,7 @@ void CAdvMapInt::select(const CArmedInstance *sel, bool centerView /*= true*/)
void CAdvMapInt::mouseMoved( const SDL_MouseMotionEvent & sEvent )
{
//adventure map scrolling with mouse
if(!SDL_GetKeyState(nullptr)[SDLK_LCTRL] && isActive())
if(!isCtrlKeyDown() && isActive())
{
if(sEvent.x<15)
{