diff options
author | frosch <frosch@openttd.org> | 2012-11-13 21:47:02 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2012-11-13 21:47:02 +0000 |
commit | c4d7c8dd427287d42374b5a83842f570642b100c (patch) | |
tree | 2f27364c8fa88537277244fade47f87bcbe4b6fd /src/window.cpp | |
parent | 7699a7dc06049956b90d3f41a14109ee05b97514 (diff) | |
download | openttd-c4d7c8dd427287d42374b5a83842f570642b100c.tar.xz |
(svn r24733) -Codechange: Move handling of editbox keys to window class.
Diffstat (limited to 'src/window.cpp')
-rw-r--r-- | src/window.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/window.cpp b/src/window.cpp index b7741be30..23db475f4 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -2263,8 +2263,13 @@ 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 */ - if (_focused_window->OnKeyPress(key, keycode) == ES_HANDLED) return; + /* All input will in this case go to the focused editbox */ + if (_focused_window->window_class == WC_CONSOLE) { + if (_focused_window->OnKeyPress(key, keycode) == ES_HANDLED) return; + } else { + QueryStringBaseWindow *query = dynamic_cast<QueryStringBaseWindow*>(_focused_window); + if (query != NULL && query->HandleEditBoxKey(_focused_window->nested_focus->index, key, keycode) == ES_HANDLED) return; + } } /* Call the event, start with the uppermost window, but ignore the toolbar. */ |