From 26be68ae9823b7a078c8251f70038d98961388bc Mon Sep 17 00:00:00 2001 From: yexo Date: Sat, 3 Jul 2010 21:43:44 +0000 Subject: (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 --- src/rail_gui.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/rail_gui.cpp') diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 66e8528d0..8d206389c 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -910,6 +910,16 @@ void ShowBuildRailToolbar(RailType railtype) _remove_button_clicked = false; } +EventState RailToolbarGlobalHotkeys(uint16 key, uint16 keycode) +{ + extern RailType _last_built_railtype; + int num = CheckHotkeyMatch(_railtoolbar_hotkeys, keycode, NULL, true); + if (num == -1) return ES_NOT_HANDLED; + ShowBuildRailToolbar(_last_built_railtype); + Window *w = FindWindowByClass(WC_BUILD_TOOLBAR); + return w->OnKeyPress(key, keycode); +} + /* TODO: For custom stations, respect their allowed platforms/lengths bitmasks! * --pasky */ -- cgit v1.2.3-54-g00ecf