From 2b23374468549722c8068d448d9bbf5e100d7301 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 22 Jun 2007 20:04:44 +0000 Subject: 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 --- backends/platform/dc/input.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'backends/platform/dc/input.cpp') 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); -- cgit v1.2.3