From 95353b0e60a8acaec28bd0e348b8f1c76d92cabf Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 27 Oct 2010 15:53:36 +0000 Subject: SWORD25: Use ScummVM keycodes This should enable use of F-keys in BS25. Most of the KEY_* constants are not used by the scripts anyway. svn-id: r53877 --- engines/sword25/input/inputengine.h | 188 ++++++++++++++++++------------------ 1 file changed, 96 insertions(+), 92 deletions(-) (limited to 'engines/sword25/input') diff --git a/engines/sword25/input/inputengine.h b/engines/sword25/input/inputengine.h index 1734a19567..4ed0bd993b 100644 --- a/engines/sword25/input/inputengine.h +++ b/engines/sword25/input/inputengine.h @@ -45,6 +45,8 @@ #ifndef SWORD25_INPUTENGINE_H #define SWORD25_INPUTENGINE_H +#include "common/keyboard.h" + #include "sword25/kernel/common.h" #include "sword25/kernel/service.h" #include "sword25/kernel/persistable.h" @@ -60,101 +62,103 @@ public: ~InputEngine(); // NOTE: These codes are registered in inputengine_script.cpp - // Any changes to these enums must also adjust the above file. + // If you add or remove entries of this enum, you must also adjust + // the above file. enum KEY_CODES { - KEY_BACKSPACE = 0x08, - KEY_TAB = 0x09, - KEY_CLEAR = 0x0C, - KEY_RETURN = 0x0D, - KEY_PAUSE = 0x13, - KEY_CAPSLOCK = 0x14, - KEY_ESCAPE = 0x1B, - KEY_SPACE = 0x20, - KEY_PAGEUP = 0x21, - KEY_PAGEDOWN = 0x22, - KEY_END = 0x23, - KEY_HOME = 0x24, - KEY_LEFT = 0x25, - KEY_UP = 0x26, - KEY_RIGHT = 0x27, - KEY_DOWN = 0x28, - KEY_PRINTSCREEN = 0x2C, - KEY_INSERT = 0x2D, - KEY_DELETE = 0x2E, - KEY_0 = 0x30, - KEY_1 = 0x31, - KEY_2 = 0x32, - KEY_3 = 0x33, - KEY_4 = 0x34, - KEY_5 = 0x35, - KEY_6 = 0x36, - KEY_7 = 0x37, - KEY_8 = 0x38, - KEY_9 = 0x39, - KEY_A = 0x41, - KEY_B = 0x42, - KEY_C = 0x43, - KEY_D = 0x44, - KEY_E = 0x45, - KEY_F = 0x46, - KEY_G = 0x47, - KEY_H = 0x48, - KEY_I = 0x49, - KEY_J = 0x4A, - KEY_K = 0x4B, - KEY_L = 0x4C, - KEY_M = 0x4D, - KEY_N = 0x4E, - KEY_O = 0x4F, - KEY_P = 0x50, - KEY_Q = 0x51, - KEY_R = 0x52, - KEY_S = 0x53, - KEY_T = 0x54, - KEY_U = 0x55, - KEY_V = 0x56, - KEY_W = 0x57, - KEY_X = 0x58, - KEY_Y = 0x59, - KEY_Z = 0x5A, - KEY_NUMPAD0 = 0x60, - KEY_NUMPAD1 = 0x61, - KEY_NUMPAD2 = 0x62, - KEY_NUMPAD3 = 0x63, - KEY_NUMPAD4 = 0x64, - KEY_NUMPAD5 = 0x65, - KEY_NUMPAD6 = 0x66, - KEY_NUMPAD7 = 0x67, - KEY_NUMPAD8 = 0x68, - KEY_NUMPAD9 = 0x69, - KEY_MULTIPLY = 0x6A, - KEY_ADD = 0x6B, - KEY_SEPARATOR = 0x6C, - KEY_SUBTRACT = 0x6D, - KEY_DECIMAL = 0x6E, - KEY_DIVIDE = 0x6F, - KEY_F1 = 0x70, - KEY_F2 = 0x71, - KEY_F3 = 0x72, - KEY_F4 = 0x73, - KEY_F5 = 0x74, - KEY_F6 = 0x75, - KEY_F7 = 0x76, - KEY_F8 = 0x77, - KEY_F9 = 0x78, - KEY_F10 = 0x79, - KEY_F11 = 0x7A, - KEY_F12 = 0x7B, - KEY_NUMLOCK = 0x90, - KEY_SCROLL = 0x91, - KEY_LSHIFT = 0xA0, - KEY_RSHIFT = 0xA1, - KEY_LCONTROL = 0xA2, - KEY_RCONTROL = 0xA3 + KEY_BACKSPACE = Common::KEYCODE_BACKSPACE, + KEY_TAB = Common::KEYCODE_TAB, + KEY_CLEAR = Common::KEYCODE_CLEAR, + KEY_RETURN = Common::KEYCODE_RETURN, + KEY_PAUSE = Common::KEYCODE_PAUSE, + KEY_CAPSLOCK = Common::KEYCODE_CAPSLOCK, + KEY_ESCAPE = Common::KEYCODE_ESCAPE, + KEY_SPACE = Common::KEYCODE_SPACE, + KEY_PAGEUP = Common::KEYCODE_PAGEUP, + KEY_PAGEDOWN = Common::KEYCODE_PAGEDOWN, + KEY_END = Common::KEYCODE_END, + KEY_HOME = Common::KEYCODE_HOME, + KEY_LEFT = Common::KEYCODE_LEFT, + KEY_UP = Common::KEYCODE_UP, + KEY_RIGHT = Common::KEYCODE_RIGHT, + KEY_DOWN = Common::KEYCODE_DOWN, + KEY_PRINTSCREEN = Common::KEYCODE_PRINT, + KEY_INSERT = Common::KEYCODE_INSERT, + KEY_DELETE = Common::KEYCODE_DELETE, + KEY_0 = Common::KEYCODE_0, + KEY_1 = Common::KEYCODE_1, + KEY_2 = Common::KEYCODE_2, + KEY_3 = Common::KEYCODE_3, + KEY_4 = Common::KEYCODE_4, + KEY_5 = Common::KEYCODE_5, + KEY_6 = Common::KEYCODE_6, + KEY_7 = Common::KEYCODE_7, + KEY_8 = Common::KEYCODE_8, + KEY_9 = Common::KEYCODE_9, + KEY_A = Common::KEYCODE_a, + KEY_B = Common::KEYCODE_b, + KEY_C = Common::KEYCODE_c, + KEY_D = Common::KEYCODE_d, + KEY_E = Common::KEYCODE_e, + KEY_F = Common::KEYCODE_f, + KEY_G = Common::KEYCODE_g, + KEY_H = Common::KEYCODE_h, + KEY_I = Common::KEYCODE_i, + KEY_J = Common::KEYCODE_j, + KEY_K = Common::KEYCODE_k, + KEY_L = Common::KEYCODE_l, + KEY_M = Common::KEYCODE_m, + KEY_N = Common::KEYCODE_n, + KEY_O = Common::KEYCODE_o, + KEY_P = Common::KEYCODE_p, + KEY_Q = Common::KEYCODE_q, + KEY_R = Common::KEYCODE_r, + KEY_S = Common::KEYCODE_s, + KEY_T = Common::KEYCODE_t, + KEY_U = Common::KEYCODE_u, + KEY_V = Common::KEYCODE_v, + KEY_W = Common::KEYCODE_w, + KEY_X = Common::KEYCODE_x, + KEY_Y = Common::KEYCODE_y, + KEY_Z = Common::KEYCODE_z, + KEY_NUMPAD0 = Common::KEYCODE_KP0, + KEY_NUMPAD1 = Common::KEYCODE_KP1, + KEY_NUMPAD2 = Common::KEYCODE_KP2, + KEY_NUMPAD3 = Common::KEYCODE_KP3, + KEY_NUMPAD4 = Common::KEYCODE_KP4, + KEY_NUMPAD5 = Common::KEYCODE_KP5, + KEY_NUMPAD6 = Common::KEYCODE_KP6, + KEY_NUMPAD7 = Common::KEYCODE_KP7, + KEY_NUMPAD8 = Common::KEYCODE_KP8, + KEY_NUMPAD9 = Common::KEYCODE_KP9, + KEY_MULTIPLY = Common::KEYCODE_KP_MULTIPLY, + KEY_ADD = Common::KEYCODE_KP_PLUS, + KEY_SEPARATOR = Common::KEYCODE_EQUALS, // FIXME: This mapping is just a wild guess!! + KEY_SUBTRACT = Common::KEYCODE_KP_MINUS, + KEY_DECIMAL = Common::KEYCODE_KP_PERIOD, + KEY_DIVIDE = Common::KEYCODE_KP_DIVIDE, + KEY_F1 = Common::KEYCODE_F1, + KEY_F2 = Common::KEYCODE_F2, + KEY_F3 = Common::KEYCODE_F3, + KEY_F4 = Common::KEYCODE_F4, + KEY_F5 = Common::KEYCODE_F5, + KEY_F6 = Common::KEYCODE_F6, + KEY_F7 = Common::KEYCODE_F7, + KEY_F8 = Common::KEYCODE_F8, + KEY_F9 = Common::KEYCODE_F9, + KEY_F10 = Common::KEYCODE_F10, + KEY_F11 = Common::KEYCODE_F11, + KEY_F12 = Common::KEYCODE_F12, + KEY_NUMLOCK = Common::KEYCODE_NUMLOCK, + KEY_SCROLL = Common::KEYCODE_SCROLLOCK, + KEY_LSHIFT = Common::KEYCODE_LSHIFT, + KEY_RSHIFT = Common::KEYCODE_RSHIFT, + KEY_LCONTROL = Common::KEYCODE_LCTRL, + KEY_RCONTROL = Common::KEYCODE_RCTRL }; - // NOTE: These codes are registered in inputengine_script.cpp. - // Any changes to these enums must also adjust the above file. + // NOTE: These codes are registered in inputengine_script.cpp + // If you add or remove entries of this enum, you must also adjust + // the above file. enum KEY_COMMANDS { KEY_COMMAND_ENTER = 1, KEY_COMMAND_LEFT = 2, -- cgit v1.2.3