Mercurial > sdl-ios-xcode
diff src/video/directfb/SDL_DirectFB_events.c @ 464:1c4be4a16410
Date: Fri, 23 Aug 2002 11:48:56 +0200
From: Denis Oliver Kropp
Subject: Another patch
this is another patch fixing key code mapping
along with some other fixes and better mode handling.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 24 Aug 2002 15:29:06 +0000 |
parents | 276d0d7ba96c |
children | b8d311d90021 |
line wrap: on
line diff
--- a/src/video/directfb/SDL_DirectFB_events.c Wed Aug 21 04:16:31 2002 +0000 +++ b/src/video/directfb/SDL_DirectFB_events.c Sat Aug 24 15:29:06 2002 +0000 @@ -100,88 +100,88 @@ for (i=0; i<SDL_TABLESIZE(keymap); ++i) keymap[i] = SDLK_UNKNOWN; - keymap[DIKI_A] = SDLK_a; - keymap[DIKI_B] = SDLK_b; - keymap[DIKI_C] = SDLK_c; - keymap[DIKI_D] = SDLK_d; - keymap[DIKI_E] = SDLK_e; - keymap[DIKI_F] = SDLK_f; - keymap[DIKI_G] = SDLK_g; - keymap[DIKI_H] = SDLK_h; - keymap[DIKI_I] = SDLK_i; - keymap[DIKI_J] = SDLK_j; - keymap[DIKI_K] = SDLK_k; - keymap[DIKI_L] = SDLK_l; - keymap[DIKI_M] = SDLK_m; - keymap[DIKI_N] = SDLK_n; - keymap[DIKI_O] = SDLK_o; - keymap[DIKI_P] = SDLK_p; - keymap[DIKI_Q] = SDLK_q; - keymap[DIKI_R] = SDLK_r; - keymap[DIKI_S] = SDLK_s; - keymap[DIKI_T] = SDLK_t; - keymap[DIKI_U] = SDLK_u; - keymap[DIKI_V] = SDLK_v; - keymap[DIKI_W] = SDLK_w; - keymap[DIKI_X] = SDLK_x; - keymap[DIKI_Y] = SDLK_y; - keymap[DIKI_Z] = SDLK_z; + keymap[DIKI_A - DIKI_UNKNOWN] = SDLK_a; + keymap[DIKI_B - DIKI_UNKNOWN] = SDLK_b; + keymap[DIKI_C - DIKI_UNKNOWN] = SDLK_c; + keymap[DIKI_D - DIKI_UNKNOWN] = SDLK_d; + keymap[DIKI_E - DIKI_UNKNOWN] = SDLK_e; + keymap[DIKI_F - DIKI_UNKNOWN] = SDLK_f; + keymap[DIKI_G - DIKI_UNKNOWN] = SDLK_g; + keymap[DIKI_H - DIKI_UNKNOWN] = SDLK_h; + keymap[DIKI_I - DIKI_UNKNOWN] = SDLK_i; + keymap[DIKI_J - DIKI_UNKNOWN] = SDLK_j; + keymap[DIKI_K - DIKI_UNKNOWN] = SDLK_k; + keymap[DIKI_L - DIKI_UNKNOWN] = SDLK_l; + keymap[DIKI_M - DIKI_UNKNOWN] = SDLK_m; + keymap[DIKI_N - DIKI_UNKNOWN] = SDLK_n; + keymap[DIKI_O - DIKI_UNKNOWN] = SDLK_o; + keymap[DIKI_P - DIKI_UNKNOWN] = SDLK_p; + keymap[DIKI_Q - DIKI_UNKNOWN] = SDLK_q; + keymap[DIKI_R - DIKI_UNKNOWN] = SDLK_r; + keymap[DIKI_S - DIKI_UNKNOWN] = SDLK_s; + keymap[DIKI_T - DIKI_UNKNOWN] = SDLK_t; + keymap[DIKI_U - DIKI_UNKNOWN] = SDLK_u; + keymap[DIKI_V - DIKI_UNKNOWN] = SDLK_v; + keymap[DIKI_W - DIKI_UNKNOWN] = SDLK_w; + keymap[DIKI_X - DIKI_UNKNOWN] = SDLK_x; + keymap[DIKI_Y - DIKI_UNKNOWN] = SDLK_y; + keymap[DIKI_Z - DIKI_UNKNOWN] = SDLK_z; - keymap[DIKI_0] = SDLK_0; - keymap[DIKI_1] = SDLK_1; - keymap[DIKI_2] = SDLK_2; - keymap[DIKI_3] = SDLK_3; - keymap[DIKI_4] = SDLK_4; - keymap[DIKI_5] = SDLK_5; - keymap[DIKI_6] = SDLK_6; - keymap[DIKI_7] = SDLK_7; - keymap[DIKI_8] = SDLK_8; - keymap[DIKI_9] = SDLK_9; + keymap[DIKI_0 - DIKI_UNKNOWN] = SDLK_0; + keymap[DIKI_1 - DIKI_UNKNOWN] = SDLK_1; + keymap[DIKI_2 - DIKI_UNKNOWN] = SDLK_2; + keymap[DIKI_3 - DIKI_UNKNOWN] = SDLK_3; + keymap[DIKI_4 - DIKI_UNKNOWN] = SDLK_4; + keymap[DIKI_5 - DIKI_UNKNOWN] = SDLK_5; + keymap[DIKI_6 - DIKI_UNKNOWN] = SDLK_6; + keymap[DIKI_7 - DIKI_UNKNOWN] = SDLK_7; + keymap[DIKI_8 - DIKI_UNKNOWN] = SDLK_8; + keymap[DIKI_9 - DIKI_UNKNOWN] = SDLK_9; - keymap[DIKI_F1] = SDLK_F1; - keymap[DIKI_F2] = SDLK_F2; - keymap[DIKI_F3] = SDLK_F3; - keymap[DIKI_F4] = SDLK_F4; - keymap[DIKI_F5] = SDLK_F5; - keymap[DIKI_F6] = SDLK_F6; - keymap[DIKI_F7] = SDLK_F7; - keymap[DIKI_F8] = SDLK_F8; - keymap[DIKI_F9] = SDLK_F9; - keymap[DIKI_F10] = SDLK_F10; - keymap[DIKI_F11] = SDLK_F11; - keymap[DIKI_F12] = SDLK_F12; + keymap[DIKI_F1 - DIKI_UNKNOWN] = SDLK_F1; + keymap[DIKI_F2 - DIKI_UNKNOWN] = SDLK_F2; + keymap[DIKI_F3 - DIKI_UNKNOWN] = SDLK_F3; + keymap[DIKI_F4 - DIKI_UNKNOWN] = SDLK_F4; + keymap[DIKI_F5 - DIKI_UNKNOWN] = SDLK_F5; + keymap[DIKI_F6 - DIKI_UNKNOWN] = SDLK_F6; + keymap[DIKI_F7 - DIKI_UNKNOWN] = SDLK_F7; + keymap[DIKI_F8 - DIKI_UNKNOWN] = SDLK_F8; + keymap[DIKI_F9 - DIKI_UNKNOWN] = SDLK_F9; + keymap[DIKI_F10 - DIKI_UNKNOWN] = SDLK_F10; + keymap[DIKI_F11 - DIKI_UNKNOWN] = SDLK_F11; + keymap[DIKI_F12 - DIKI_UNKNOWN] = SDLK_F12; - keymap[DIKI_ESCAPE] = SDLK_ESCAPE; - keymap[DIKI_LEFT] = SDLK_LEFT; - keymap[DIKI_RIGHT] = SDLK_RIGHT; - keymap[DIKI_UP] = SDLK_UP; - keymap[DIKI_DOWN] = SDLK_DOWN; - keymap[DIKI_CONTROL_L] = SDLK_LCTRL; - keymap[DIKI_CONTROL_R] = SDLK_RCTRL; - keymap[DIKI_SHIFT_L] = SDLK_LSHIFT; - keymap[DIKI_SHIFT_R] = SDLK_RSHIFT; - keymap[DIKI_ALT_L] = SDLK_LALT; - keymap[DIKI_ALTGR] = SDLK_RALT; - keymap[DIKI_TAB] = SDLK_TAB; - keymap[DIKI_ENTER] = SDLK_RETURN; - keymap[DIKI_SPACE] = SDLK_SPACE; - keymap[DIKI_BACKSPACE] = SDLK_BACKSPACE; - keymap[DIKI_INSERT] = SDLK_INSERT; - keymap[DIKI_DELETE] = SDLK_DELETE; - keymap[DIKI_HOME] = SDLK_HOME; - keymap[DIKI_END] = SDLK_END; - keymap[DIKI_PAGE_UP] = SDLK_PAGEUP; - keymap[DIKI_PAGE_DOWN] = SDLK_PAGEDOWN; - keymap[DIKI_CAPS_LOCK] = SDLK_CAPSLOCK; - keymap[DIKI_NUM_LOCK] = SDLK_NUMLOCK; - keymap[DIKI_SCROLL_LOCK] = SDLK_SCROLLOCK; - keymap[DIKI_PRINT] = SDLK_PRINT; - keymap[DIKI_PAUSE] = SDLK_PAUSE; - keymap[DIKI_KP_DIV] = SDLK_KP_DIVIDE; - keymap[DIKI_KP_MULT] = SDLK_KP_MULTIPLY; - keymap[DIKI_KP_MINUS] = SDLK_KP_MINUS; - keymap[DIKI_KP_PLUS] = SDLK_KP_PLUS; - keymap[DIKI_KP_ENTER] = SDLK_KP_ENTER; + keymap[DIKI_ESCAPE - DIKI_UNKNOWN] = SDLK_ESCAPE; + keymap[DIKI_LEFT - DIKI_UNKNOWN] = SDLK_LEFT; + keymap[DIKI_RIGHT - DIKI_UNKNOWN] = SDLK_RIGHT; + keymap[DIKI_UP - DIKI_UNKNOWN] = SDLK_UP; + keymap[DIKI_DOWN - DIKI_UNKNOWN] = SDLK_DOWN; + keymap[DIKI_CONTROL_L - DIKI_UNKNOWN] = SDLK_LCTRL; + keymap[DIKI_CONTROL_R - DIKI_UNKNOWN] = SDLK_RCTRL; + keymap[DIKI_SHIFT_L - DIKI_UNKNOWN] = SDLK_LSHIFT; + keymap[DIKI_SHIFT_R - DIKI_UNKNOWN] = SDLK_RSHIFT; + keymap[DIKI_ALT_L - DIKI_UNKNOWN] = SDLK_LALT; + keymap[DIKI_ALTGR - DIKI_UNKNOWN] = SDLK_RALT; + keymap[DIKI_TAB - DIKI_UNKNOWN] = SDLK_TAB; + keymap[DIKI_ENTER - DIKI_UNKNOWN] = SDLK_RETURN; + keymap[DIKI_SPACE - DIKI_UNKNOWN] = SDLK_SPACE; + keymap[DIKI_BACKSPACE - DIKI_UNKNOWN] = SDLK_BACKSPACE; + keymap[DIKI_INSERT - DIKI_UNKNOWN] = SDLK_INSERT; + keymap[DIKI_DELETE - DIKI_UNKNOWN] = SDLK_DELETE; + keymap[DIKI_HOME - DIKI_UNKNOWN] = SDLK_HOME; + keymap[DIKI_END - DIKI_UNKNOWN] = SDLK_END; + keymap[DIKI_PAGE_UP - DIKI_UNKNOWN] = SDLK_PAGEUP; + keymap[DIKI_PAGE_DOWN - DIKI_UNKNOWN] = SDLK_PAGEDOWN; + keymap[DIKI_CAPS_LOCK - DIKI_UNKNOWN] = SDLK_CAPSLOCK; + keymap[DIKI_NUM_LOCK - DIKI_UNKNOWN] = SDLK_NUMLOCK; + keymap[DIKI_SCROLL_LOCK - DIKI_UNKNOWN] = SDLK_SCROLLOCK; + keymap[DIKI_PRINT - DIKI_UNKNOWN] = SDLK_PRINT; + keymap[DIKI_PAUSE - DIKI_UNKNOWN] = SDLK_PAUSE; + keymap[DIKI_KP_DIV - DIKI_UNKNOWN] = SDLK_KP_DIVIDE; + keymap[DIKI_KP_MULT - DIKI_UNKNOWN] = SDLK_KP_MULTIPLY; + keymap[DIKI_KP_MINUS - DIKI_UNKNOWN] = SDLK_KP_MINUS; + keymap[DIKI_KP_PLUS - DIKI_UNKNOWN] = SDLK_KP_PLUS; + keymap[DIKI_KP_ENTER - DIKI_UNKNOWN] = SDLK_KP_ENTER; } @@ -195,7 +195,7 @@ if (ev->key_symbol > 0 && ev->key_symbol < 128) keysym->sym = ev->key_symbol; else - keysym->sym = keymap[ev->key_id]; + keysym->sym = keymap[ev->key_id - DIKI_UNKNOWN]; return keysym; }