summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/misc_gui.cpp6
-rw-r--r--src/network/network_gui.cpp2
-rw-r--r--src/window.cpp3
3 files changed, 5 insertions, 6 deletions
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index ce7215c6e..fc6deecab 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -993,8 +993,8 @@ HandleEditBoxResult QueryString::HandleEditBoxKey(Window *w, int wid, uint16 key
default:
if (IsValidChar(key, this->afilter)) {
if (InsertTextBufferChar(&this->text, key)) w->InvalidateWidget(wid);
- } else { // key wasn't caught. Continue only if standard entry specified
- state = (this->afilter == CS_ALPHANUMERAL) ? Window::ES_HANDLED : Window::ES_NOT_HANDLED;
+ } else {
+ state = Window::ES_NOT_HANDLED;
}
}
@@ -1134,7 +1134,7 @@ struct QueryStringWindow : public QueryStringBaseWindow
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
{
- EventState state;
+ EventState state = ES_NOT_HANDLED;
switch (this->HandleEditBoxKey(QUERY_STR_WIDGET_TEXT, key, keycode, state)) {
default: NOT_REACHED();
case HEBR_EDITING: {
diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp
index 4edd09f8a..75046e487 100644
--- a/src/network/network_gui.cpp
+++ b/src/network/network_gui.cpp
@@ -1927,7 +1927,7 @@ struct NetworkCompanyPasswordWindow : public QueryStringBaseWindow {
virtual EventState OnKeyPress(uint16 key, uint16 keycode)
{
- EventState state;
+ EventState state = ES_NOT_HANDLED;
switch (this->HandleEditBoxKey(4, key, keycode, state)) {
default: break;
diff --git a/src/window.cpp b/src/window.cpp
index a72935021..b2fa9e131 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -1750,8 +1750,7 @@ void HandleKeypress(uint32 raw_key)
/* Check if the focused window has a focused editbox */
if (EditBoxInGlobalFocus()) {
/* All input will in this case go to the focused window */
- _focused_window->OnKeyPress(key, keycode);
- return;
+ if (_focused_window->OnKeyPress(key, keycode) == Window::ES_HANDLED) return;
}
/* Call the event, start with the uppermost window. */