diff options
author | Max Horn | 2003-07-22 16:30:00 +0000 |
---|---|---|
committer | Max Horn | 2003-07-22 16:30:00 +0000 |
commit | 660ca0f52657a633f7852019b6242cfabe319c70 (patch) | |
tree | 6135fadfbffa18f818bd196506a9a53f286eab71 /gui | |
parent | ece1b83ac149d89a86cbd704024b9412251aa80a (diff) | |
download | scummvm-rg350-660ca0f52657a633f7852019b6242cfabe319c70.tar.gz scummvm-rg350-660ca0f52657a633f7852019b6242cfabe319c70.tar.bz2 scummvm-rg350-660ca0f52657a633f7852019b6242cfabe319c70.zip |
fixed button hotkeys in dialogs with a focused widget (e.g. the F5 save/load dialog)
svn-id: r9127
Diffstat (limited to 'gui')
-rw-r--r-- | gui/dialog.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/gui/dialog.cpp b/gui/dialog.cpp index 745e48ce10..42f6711542 100644 --- a/gui/dialog.cpp +++ b/gui/dialog.cpp @@ -181,20 +181,20 @@ void Dialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) { if (_focusedWidget) { if (_focusedWidget->handleKeyDown(ascii, keycode, modifiers)) return; - } else { - // Hotkey handling - Widget *w = _firstWidget; - ascii = toupper(ascii); - while (w) { - if (w->_type == kButtonWidget && ascii == toupper(((ButtonWidget *)w)->_hotkey)) { - // We first send a mouseDown then a mouseUp. - // FIXME: insert a brief delay between both. - w->handleMouseDown(0, 0, 1, 1); - w->handleMouseUp(0, 0, 1, 1); - return; - } - w = w->_next; + } + + // Hotkey handling + Widget *w = _firstWidget; + ascii = toupper(ascii); + while (w) { + if (w->_type == kButtonWidget && 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); + w->handleMouseUp(0, 0, 1, 1); + return; } + w = w->_next; } // ESC closes all dialogs by default |