1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-17 00:07:41 +02:00

Capture events in chat box

This commit is contained in:
nordsoft
2023-10-01 16:40:26 +02:00
parent d695d87b99
commit 213d0c3553
2 changed files with 6 additions and 0 deletions

View File

@ -327,6 +327,11 @@ CChatBox::CChatBox(const Rect & rect)
chatHistory->label->color = Colors::GREEN;
}
bool CChatBox::captureThisKey(EShortcut key)
{
return !inputBox->getText().empty() && key == EShortcut::GLOBAL_ACCEPT;
}
void CChatBox::keyPressed(EShortcut key)
{
if(key == EShortcut::GLOBAL_ACCEPT && inputBox->getText().size())