aboutsummaryrefslogtreecommitdiff
path: root/gui/about.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/about.cpp')
-rw-r--r--gui/about.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/gui/about.cpp b/gui/about.cpp
index 4f4e932fb5..d5f4c2d4e2 100644
--- a/gui/about.cpp
+++ b/gui/about.cpp
@@ -82,7 +82,7 @@ static const char *credits_intro[] = {
AboutDialog::AboutDialog()
: Dialog(10, 20, 300, 174),
- _scrollPos(0), _scrollTime(0), _modifiers(0) {
+ _scrollPos(0), _scrollTime(0), _modifiers(0), _willClose(false) {
int i;
@@ -116,6 +116,8 @@ AboutDialog::AboutDialog()
void AboutDialog::open() {
_scrollTime = g_system->getMillis() + kScrollStartDelay;
_scrollPos = 0;
+ _modifiers = 0;
+ _willClose = false;
Dialog::open();
}
@@ -222,11 +224,13 @@ void AboutDialog::handleMouseUp(int x, int y, int button, int clickCount) {
void AboutDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
_modifiers = modifiers;
+ if (ascii)
+ _willClose = true;
}
void AboutDialog::handleKeyUp(uint16 ascii, int keycode, int modifiers) {
_modifiers = modifiers;
- if (ascii)
+ if (ascii && _willClose)
close();
}