1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-10-18 01:16:37 +00:00

Add controller support to text input menu

This commit is contained in:
Andrew Lanzone 2025-05-11 14:56:58 -07:00
parent 1e200ed048
commit 5e7761bef1
2 changed files with 11 additions and 0 deletions

View file

@ -83,4 +83,14 @@ namespace MWGui
mTextEdit->setCaption(text);
}
bool TextInputDialog::onControllerButtonEvent(const SDL_ControllerButtonEvent& arg)
{
if (arg.button == SDL_CONTROLLER_BUTTON_A)
{
onOkClicked(nullptr);
return true;
}
return false;
}
}

View file

@ -27,6 +27,7 @@ namespace MWGui
protected:
void onOkClicked(MyGUI::Widget* _sender);
void onTextAccepted(MyGUI::EditBox* _sender);
bool onControllerButtonEvent(const SDL_ControllerButtonEvent& arg) override;
private:
MyGUI::EditBox* mTextEdit;