aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/dc
diff options
context:
space:
mode:
authorMax Horn2007-06-22 20:04:44 +0000
committerMax Horn2007-06-22 20:04:44 +0000
commit2b23374468549722c8068d448d9bbf5e100d7301 (patch)
tree0f932d85abb78a4dc9ecc93799ab7763753f3243 /backends/platform/dc
parent2496c5b5549f7b3b3f1d7777812631505f8d578f (diff)
downloadscummvm-rg350-2b23374468549722c8068d448d9bbf5e100d7301.tar.gz
scummvm-rg350-2b23374468549722c8068d448d9bbf5e100d7301.tar.bz2
scummvm-rg350-2b23374468549722c8068d448d9bbf5e100d7301.zip
Converted lots of code to use Common::ASCII_* and COMMON::KEYCODE_* constants. This also revealed the evil mixing of keycodes and ascii we do in many places :-/
svn-id: r27616
Diffstat (limited to 'backends/platform/dc')
-rw-r--r--backends/platform/dc/input.cpp16
-rw-r--r--backends/platform/dc/selector.cpp2
-rw-r--r--backends/platform/dc/softkbd.cpp4
3 files changed, 11 insertions, 11 deletions
diff --git a/backends/platform/dc/input.cpp b/backends/platform/dc/input.cpp
index 7a5e5911d8..f3638a28db 100644
--- a/backends/platform/dc/input.cpp
+++ b/backends/platform/dc/input.cpp
@@ -48,7 +48,7 @@ int handleInput(struct mapledev *pad, int &mouse_x, int &mouse_y,
if(!(buttons & 4)) lmb++;
if(!(buttons & 2)) rmb++;
- if(!(buttons & 8)) newkey = 319;
+ if(!(buttons & 8)) newkey = Common::ASCII_F5;
else if(!(buttons & 512)) newkey = ' ';
else if(!(buttons & 1024)) newkey = numpadmap[(buttons>>4)&15];
@@ -69,7 +69,7 @@ int handleInput(struct mapledev *pad, int &mouse_x, int &mouse_y,
if(!(buttons & 4)) lmb++;
if(!(buttons & 2)) rmb++;
- if(!(buttons & 8)) newkey = 319;
+ if(!(buttons & 8)) newkey = Common::ASCII_F5;
mouse_x += pad->cond.mouse.axis1;
mouse_y += pad->cond.mouse.axis2;
@@ -101,22 +101,22 @@ int handleInput(struct mapledev *pad, int &mouse_x, int &mouse_y,
"=¯`{ }+*½<>?" :
"-^@[ ];:§,./")[key - 0x2d];
else if(key >= 0x3a && key <= 0x43)
- newkey = key+(315-0x3a);
+ newkey = key+(Common::ASCII_F1-0x3a);
else if(key >= 0x54 && key <= 0x57)
newkey = "/*-+"[key-0x54];
else switch(key) {
case 0x27: case 0x62:
newkey = ((shift & 0x22)? '~' : '0'); break;
case 0x28: case 0x58:
- newkey = 13; break;
+ newkey = Common::KEYCODE_RETURN; break;
case 0x29:
- newkey = 27; break;
+ newkey = Common::KEYCODE_ESCAPE; break;
case 0x2a:
- newkey = 8; break;
+ newkey = Common::KEYCODE_BACKSPACE; break;
case 0x2b:
- newkey = 9; break;
+ newkey = Common::KEYCODE_TAB; break;
case 0x2c:
- newkey = ' '; break;
+ newkey = Common::KEYCODE_SPACE; break;
case 0x4c:
if((shift & 0x11) && (shift & 0x44))
exit(0);
diff --git a/backends/platform/dc/selector.cpp b/backends/platform/dc/selector.cpp
index a4fec642fe..8262a39614 100644
--- a/backends/platform/dc/selector.cpp
+++ b/backends/platform/dc/selector.cpp
@@ -364,7 +364,7 @@ int gameMenu(Game *games, int num_games)
event = handleInput(locked_get_pads(), mousex, mousey, shiftFlags);
setimask(mask);
- if(event==-Common::EVENT_LBUTTONDOWN || event==13 || event==319) {
+ if(event==-Common::EVENT_LBUTTONDOWN || event==13 || event==Common::ASCII_F5) {
int selected_game = top_game + selector_pos;
for(int fade=0; fade<=256; fade+=4) {
diff --git a/backends/platform/dc/softkbd.cpp b/backends/platform/dc/softkbd.cpp
index e8436fc30a..58b492f6db 100644
--- a/backends/platform/dc/softkbd.cpp
+++ b/backends/platform/dc/softkbd.cpp
@@ -52,7 +52,7 @@ static const char key_names[] =
static const short key_codes[] =
{
- 27, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
+ Common::KEYCODE_ESCAPE, Common::ASCII_F1, Common::ASCII_F2, Common::ASCII_F3, Common::ASCII_F4, Common::ASCII_F5, Common::ASCII_F6, Common::ASCII_F7, Common::ASCII_F8, Common::ASCII_F9, Common::ASCII_F10,
K('1','!'), K('2','"'), K('3','#'), K('4','$'), K('5','%'),
K('6','&'), K('7','\''), K('8','('), K('9',')'), K('0','~'), K('-','='),
K('q','Q'), K('w','W'), K('e','E'), K('r','R'), K('t','T'),
@@ -61,7 +61,7 @@ static const short key_codes[] =
K('h','H'), K('j','J'), K('k','K'), K('l','L'), K(';','+'), K(':','*'),
K('z','Z'), K('x','X'), K('c','C'), K('v','V'), K('b','B'),
K('n','N'), K('m','M'), K(',','<'), K('.','>'), K('/','?'), K('\\','_'),
- ~Common::KBD_SHIFT, ~Common::KBD_CTRL, ~Common::KBD_ALT, ' ', 8, 13
+ ~Common::KBD_SHIFT, ~Common::KBD_CTRL, ~Common::KBD_ALT, ' ', Common::KEYCODE_BACKSPACE, Common::KEYCODE_RETURN
};
SoftKeyboard::SoftKeyboard(const OSystem_Dreamcast *_os)