aboutsummaryrefslogtreecommitdiff
path: root/gui/PopUpWidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/PopUpWidget.cpp')
-rw-r--r--gui/PopUpWidget.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/gui/PopUpWidget.cpp b/gui/PopUpWidget.cpp
index 1bdce8a24e..d40a01c981 100644
--- a/gui/PopUpWidget.cpp
+++ b/gui/PopUpWidget.cpp
@@ -24,6 +24,7 @@
#include "common/stdafx.h"
#include "common/system.h"
+#include "common/events.h"
#include "gui/dialog.h"
#include "gui/eval.h"
#include "gui/newgui.h"
@@ -210,7 +211,7 @@ void PopUpDialog::handleMouseMoved(int x, int y, int button) {
}
void PopUpDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
- if (keycode == 27) { // escape
+ if (keycode == Common::KEYCODE_ESCAPE) {
// Don't change the previous selection
setResult(-1);
close();
@@ -221,21 +222,21 @@ void PopUpDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
return;
switch (keycode) {
- case '\n': // enter/return
- case '\r':
+ case Common::KEYCODE_RETURN:
+ case Common::KEYCODE_KP_ENTER:
setResult(_selection);
close();
break;
- case 256+17: // up arrow
+ case Common::KEYCODE_UP:
moveUp();
break;
- case 256+18: // down arrow
+ case Common::KEYCODE_DOWN:
moveDown();
break;
- case 256+22: // home
+ case Common::KEYCODE_HOME:
setSelection(0);
break;
- case 256+23: // end
+ case Common::KEYCODE_END:
setSelection(_popUpBoss->_entries.size()-1);
break;
}