1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +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

@@ -43,8 +43,6 @@
#include "../../lib/mapping/CMapInfo.h"
#include "../../lib/serializer/Connection.h"
#include <SDL_events.h>
ISelectionScreenInfo::ISelectionScreenInfo(ESelectionScreen ScreenType)
: screenType(ScreenType)
{
@@ -320,15 +318,15 @@ CChatBox::CChatBox(const Rect & rect)
chatHistory->label->color = Colors::GREEN;
}
void CChatBox::keyPressed(const SDL_KeyboardEvent & key)
void CChatBox::keyDown(const SDL_Keycode & key)
{
if(key.keysym.sym == SDLK_RETURN && key.state == SDL_PRESSED && inputBox->getText().size())
if(key == SDLK_RETURN && inputBox->getText().size())
{
CSH->sendMessage(inputBox->getText());
inputBox->setText("");
}
else
inputBox->keyPressed(key);
inputBox->keyDown(key);
}
void CChatBox::addNewMessage(const std::string & text)