aboutsummaryrefslogtreecommitdiff
path: root/gui/dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/dialog.cpp')
-rw-r--r--gui/dialog.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/gui/dialog.cpp b/gui/dialog.cpp
index 1afd18ec52..f643e6f988 100644
--- a/gui/dialog.cpp
+++ b/gui/dialog.cpp
@@ -211,18 +211,18 @@ void Dialog::handleMouseWheel(int x, int y, int direction) {
w->handleMouseWheel(x, y, direction);
}
-void Dialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
+void Dialog::handleKeyDown(Common::KeyState state) {
if (_focusedWidget) {
- if (_focusedWidget->handleKeyDown(ascii, keycode, modifiers))
+ if (_focusedWidget->handleKeyDown(state))
return;
}
// Hotkey handling
- if (ascii != 0) {
+ if (state.ascii != 0) {
Widget *w = _firstWidget;
- ascii = toupper(ascii);
+ state.ascii = toupper(state.ascii);
while (w) {
- if (w->_type == kButtonWidget && ascii == toupper(((ButtonWidget *)w)->_hotkey)) {
+ if (w->_type == kButtonWidget && state.ascii == toupper(((ButtonWidget *)w)->_hotkey)) {
// The hotkey for widget w was pressed. We fake a mouse click into the
// button by invoking the appropriate methods.
w->handleMouseDown(0, 0, 1, 1);
@@ -234,7 +234,7 @@ void Dialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
}
// ESC closes all dialogs by default
- if (keycode == Common::KEYCODE_ESCAPE) {
+ if (state.keycode == Common::KEYCODE_ESCAPE) {
setResult(-1);
close();
}
@@ -242,10 +242,10 @@ void Dialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
// TODO: tab/shift-tab should focus the next/previous focusable widget
}
-void Dialog::handleKeyUp(uint16 ascii, int keycode, int modifiers) {
+void Dialog::handleKeyUp(Common::KeyState state) {
// Focused widget receives keyup events
if (_focusedWidget)
- _focusedWidget->handleKeyUp(ascii, keycode, modifiers);
+ _focusedWidget->handleKeyUp(state);
}
void Dialog::handleMouseMoved(int x, int y, int button) {