summaryrefslogtreecommitdiff
path: root/src/dock_gui.cpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-07-03 21:43:44 +0000
committeryexo <yexo@openttd.org>2010-07-03 21:43:44 +0000
commit26be68ae9823b7a078c8251f70038d98961388bc (patch)
treedcd4778a53008b1805224ae3143dd7511adb3b20 /src/dock_gui.cpp
parent9be9302cdbe5e23ad7565e7d76b9ac2414fb0796 (diff)
downloadopenttd-26be68ae9823b7a078c8251f70038d98961388bc.tar.xz
(svn r20070) -Feature: when none of the open windows handles a keypress, try all toolbars for global hotkeys
Users that have run a version between r20056 and r20068 should delete their hotkeys.cfg to reset the terraform toolbar hotkeys to default
Diffstat (limited to 'src/dock_gui.cpp')
-rw-r--r--src/dock_gui.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp
index 72e2b234d..54756608f 100644
--- a/src/dock_gui.cpp
+++ b/src/dock_gui.cpp
@@ -302,6 +302,15 @@ void ShowBuildDocksToolbar()
AllocateWindowDescFront<BuildDocksToolbarWindow>(&_build_docks_toolbar_desc, TRANSPORT_WATER);
}
+EventState DockToolbarGlobalHotkeys(uint16 key, uint16 keycode)
+{
+ int num = CheckHotkeyMatch<BuildDocksToolbarWindow>(_dockstoolbar_hotkeys, keycode, NULL, true);
+ if (num == -1) return ES_NOT_HANDLED;
+ ShowBuildDocksToolbar();
+ Window *w = FindWindowByClass(WC_BUILD_TOOLBAR);
+ return w->OnKeyPress(key, keycode);
+}
+
/**
* Nested widget parts of docks toolbar, scenario editor version.
* Positions of #DTW_DEPOT, #DTW_STATION, and #DTW_BUOY widgets have changed.