diff options
Diffstat (limited to 'src/osk_gui.cpp')
-rw-r--r-- | src/osk_gui.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/osk_gui.cpp b/src/osk_gui.cpp index a4906c1ed..42208110e 100644 --- a/src/osk_gui.cpp +++ b/src/osk_gui.cpp @@ -131,6 +131,21 @@ struct OskWindow : public Window { } switch (widget) { + case OSK_WIDGET_TEXT: + /* Find the edit box of the parent window and give focus to that */ + for (uint i = 0; i < this->parent->widget_count; i++) { + Widget &wi = this->parent->widget[i]; + if (wi.type == WWT_EDITBOX) { + this->parent->focused_widget = &wi; + break; + } + } + + /* Give focus to parent window */ + SetFocusedWindow(this->parent); + + break; + case OSK_WIDGET_BACKSPACE: if (DeleteTextBufferChar(&this->qs->text, WKC_BACKSPACE)) this->InvalidateParent(); break; |