From 4305483ad01292482b5f2ea6fa6116418288ba90 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Fri, 22 Jun 2007 07:49:02 +0000 Subject: Use KEYCODE constants. svn-id: r27598 --- gui/PopUpWidget.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'gui/PopUpWidget.cpp') 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; } -- cgit v1.2.3