summaryrefslogtreecommitdiff
path: root/src/main_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-05-17 23:11:06 +0000
committerrubidium <rubidium@openttd.org>2008-05-17 23:11:06 +0000
commitf5681547efc060ab0cc47c36316c4f2aa1217948 (patch)
treecdbaf12f7c5a7666ecc23983c51dca268e3b58e2 /src/main_gui.cpp
parentc1713c9ab7438386dbda32b4c33e95995882f702 (diff)
downloadopenttd-f5681547efc060ab0cc47c36316c4f2aa1217948.tar.xz
(svn r13151) -Codechange: use an enum instead of bool as return type of OnKeyPress/OnCTRLStateChange to make it obvious what the return values mean.
Diffstat (limited to 'src/main_gui.cpp')
-rw-r--r--src/main_gui.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/main_gui.cpp b/src/main_gui.cpp
index 7fd97015d..36cda036b 100644
--- a/src/main_gui.cpp
+++ b/src/main_gui.cpp
@@ -239,34 +239,34 @@ struct MainWindow : Window
}
}
- virtual bool OnKeyPress(uint16 key, uint16 keycode)
+ virtual EventState OnKeyPress(uint16 key, uint16 keycode)
{
switch (keycode) {
case 'Q' | WKC_CTRL:
case 'Q' | WKC_META:
HandleExitGameRequest();
- return true;
+ return ES_HANDLED;
}
/* Disable all key shortcuts, except quit shortcuts when
* generating the world, otherwise they create threading
* problem during the generating, resulting in random
* assertions that are hard to trigger and debug */
- if (IsGeneratingWorld()) return true;
+ if (IsGeneratingWorld()) return ES_NOT_HANDLED;
if (keycode == WKC_BACKQUOTE) {
IConsoleSwitch();
- return false;
+ return ES_HANDLED;
}
if (keycode == ('B' | WKC_CTRL)) {
extern bool _draw_bounding_boxes;
_draw_bounding_boxes = !_draw_bounding_boxes;
MarkWholeScreenDirty();
- return false;
+ return ES_HANDLED;
}
- if (_game_mode == GM_MENU) return true;
+ if (_game_mode == GM_MENU) return ES_NOT_HANDLED;
switch (keycode) {
case 'C':
@@ -372,9 +372,9 @@ struct MainWindow : Window
break;
#endif
- default: return true;
+ default: return ES_NOT_HANDLED;
}
- return false;
+ return ES_HANDLED;
}
virtual void OnScroll(Point delta)