diff options
author | yexo <yexo@openttd.org> | 2009-03-11 09:21:11 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2009-03-11 09:21:11 +0000 |
commit | fbe159ab9e9a71e8cef3c0352ae97bc02a131be5 (patch) | |
tree | 90bfe71b0685ad9f8fb2a7c2ad7a7ab4b4b1b36a /src/misc_gui.cpp | |
parent | 28c49b694a61cc5a5ec885a847ce8f781139b4bd (diff) | |
download | openttd-fbe159ab9e9a71e8cef3c0352ae97bc02a131be5.tar.xz |
(svn r15669) -Change: Key presses that are not handles by an input box are no longer marked as handled but given to other OnKeyPress handlers. This makes the global shortcuts like F1 work again when an input box is open.
Diffstat (limited to 'src/misc_gui.cpp')
-rw-r--r-- | src/misc_gui.cpp | 6 |
1 files changed, 3 insertions, 3 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: { |