1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-12-01 23:12:49 +02:00

Removed usage of SDL_KeyboardEvent from UI code

This commit is contained in:
Ivan Savenko
2023-02-02 18:02:25 +02:00
parent 860fe43131
commit d4fba3787c
26 changed files with 160 additions and 131 deletions

View File

@@ -91,13 +91,11 @@ void CInGameConsole::print(const std::string &txt)
}
}
void CInGameConsole::keyPressed (const SDL_KeyboardEvent & key)
void CInGameConsole::keyDown (const SDL_Keycode & key)
{
if(key.type != SDL_KEYDOWN) return;
if(!captureAllKeys && key != SDLK_TAB) return; //because user is not entering any text
if(!captureAllKeys && key.keysym.sym != SDLK_TAB) return; //because user is not entering any text
switch(key.keysym.sym)
switch(key)
{
case SDLK_TAB:
case SDLK_ESCAPE:
@@ -106,7 +104,7 @@ void CInGameConsole::keyPressed (const SDL_KeyboardEvent & key)
{
endEnteringText(false);
}
else if(SDLK_TAB == key.keysym.sym)
else if(SDLK_TAB == key)
{
startEnteringText();
}