aboutsummaryrefslogtreecommitdiff
path: root/engines/cine
diff options
context:
space:
mode:
authorMax Horn2007-06-22 21:10:57 +0000
committerMax Horn2007-06-22 21:10:57 +0000
commit54d668ac13f57d8acf5d8e627a5daeaa8166ecb3 (patch)
treeff16ba9d667c29b9f24286a7f27d2beab845936b /engines/cine
parente8a4d396fe08cde375c9193a4dbb8847f663e774 (diff)
downloadscummvm-rg350-54d668ac13f57d8acf5d8e627a5daeaa8166ecb3.tar.gz
scummvm-rg350-54d668ac13f57d8acf5d8e627a5daeaa8166ecb3.tar.bz2
scummvm-rg350-54d668ac13f57d8acf5d8e627a5daeaa8166ecb3.zip
Changed more code to use Common::KEYCODE_ enum
svn-id: r27624
Diffstat (limited to 'engines/cine')
-rw-r--r--engines/cine/main_loop.cpp24
-rw-r--r--engines/cine/various.cpp22
2 files changed, 23 insertions, 23 deletions
diff --git a/engines/cine/main_loop.cpp b/engines/cine/main_loop.cpp
index b55ee361c2..7ad20a7ec7 100644
--- a/engines/cine/main_loop.cpp
+++ b/engines/cine/main_loop.cpp
@@ -70,61 +70,61 @@ void manageEvents(int count) {
break;
case Common::EVENT_KEYDOWN:
switch (event.kbd.keycode) {
- case '\n':
- case '\r':
- case 261: // Keypad 5
+ case Common::KEYCODE_RETURN:
+ case Common::KEYCODE_KP_ENTER:
+ case Common::KEYCODE_KP5:
if (allowPlayerInput) {
mouseLeft = 1;
}
break;
- case 27: // ESC
+ case Common::KEYCODE_ESC:
if (allowPlayerInput) {
mouseRight = 1;
}
break;
- case 282: // F1
+ case Common::KEYCODE_F1:
if (allowPlayerInput) {
playerCommand = 0; // EXAMINE
makeCommandLine();
}
break;
- case 283: // F2
+ case Common::KEYCODE_F2:
if (allowPlayerInput) {
playerCommand = 1; // TAKE
makeCommandLine();
}
break;
- case 284: // F3
+ case Common::KEYCODE_F3:
if (allowPlayerInput) {
playerCommand = 2; // INVENTORY
makeCommandLine();
}
break;
- case 285: // F4
+ case Common::KEYCODE_F4:
if (allowPlayerInput) {
playerCommand = 3; // USE
makeCommandLine();
}
break;
- case 286: // F5
+ case Common::KEYCODE_F5:
if (allowPlayerInput) {
playerCommand = 4; // ACTIVATE
makeCommandLine();
}
break;
- case 287: // F6
+ case Common::KEYCODE_F6:
if (allowPlayerInput) {
playerCommand = 5; // SPEAK
makeCommandLine();
}
break;
- case 290: // F9
+ case Common::KEYCODE_F9:
if (allowPlayerInput && !inMenu) {
makeActionMenu();
makeCommandLine();
}
break;
- case 291: // F10
+ case Common::KEYCODE_F10:
if (!disableSystemMenu && !inMenu) {
g_cine->makeSystemMenu();
}
diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp
index c9bb672e21..e17f68b36b 100644
--- a/engines/cine/various.cpp
+++ b/engines/cine/various.cpp
@@ -3204,7 +3204,7 @@ bool makeTextEntryMenu(const char *messagePtr, char *inputString, int stringMaxL
ch[1] = 0;
manageEvents();
- int ascii = getKeyData();
+ int keycode = getKeyData();
uint16 mouseButton, mouseX, mouseY;
getMouseData(0, &mouseButton, &mouseX, &mouseY);
@@ -3214,14 +3214,14 @@ bool makeTextEntryMenu(const char *messagePtr, char *inputString, int stringMaxL
else if (mouseButton & 1)
quit = 1;
- switch (ascii) {
- case 8: // backspace
+ switch (keycode) {
+ case Common::KEYCODE_BACKSPACE:
if (inputPos <= 1) {
break;
}
inputPos--;
redraw = true;
- case 127: // del
+ case Common::KEYCODE_DELETE:
if (inputPos <= inputLength) {
if (inputPos != 1) {
strncpy(tempString, inputString, inputPos - 1);
@@ -3234,25 +3234,25 @@ bool makeTextEntryMenu(const char *messagePtr, char *inputString, int stringMaxL
redraw = true;
}
break;
- case 276: // left
+ case Common::KEYCODE_LEFT:
if (inputPos > 1) {
inputPos--;
redraw = true;
}
break;
- case 275: // right
+ case Common::KEYCODE_RIGHT:
if (inputPos <= inputLength) {
inputPos++;
redraw = true;
}
break;
default:
- if (((ascii >= 'a') && (ascii <='z')) ||
- ((ascii >= '0') && (ascii <='9')) ||
- ((ascii >= 'A') && (ascii <='Z')) ||
- (ascii == ' ')) {
+ if (((keycode >= 'a') && (keycode <='z')) ||
+ ((keycode >= '0') && (keycode <='9')) ||
+ ((keycode >= 'A') && (keycode <='Z')) ||
+ (keycode == ' ')) {
if (inputLength < stringMaxLength - 1) {
- ch[0] = ascii;
+ ch[0] = keycode;
if (inputPos != 1) {
strncpy(tempString, inputString, inputPos - 1);
strcat(tempString, ch);