src/video/directfb/SDL_DirectFB_events.c
changeset 464 1c4be4a16410
parent 395 276d0d7ba96c
child 769 b8d311d90021
     1.1 --- a/src/video/directfb/SDL_DirectFB_events.c	Wed Aug 21 04:16:31 2002 +0000
     1.2 +++ b/src/video/directfb/SDL_DirectFB_events.c	Sat Aug 24 15:29:06 2002 +0000
     1.3 @@ -100,88 +100,88 @@
     1.4    for (i=0; i<SDL_TABLESIZE(keymap); ++i)
     1.5      keymap[i] = SDLK_UNKNOWN;
     1.6  
     1.7 -  keymap[DIKI_A] = SDLK_a;
     1.8 -  keymap[DIKI_B] = SDLK_b;
     1.9 -  keymap[DIKI_C] = SDLK_c;
    1.10 -  keymap[DIKI_D] = SDLK_d;
    1.11 -  keymap[DIKI_E] = SDLK_e;
    1.12 -  keymap[DIKI_F] = SDLK_f;
    1.13 -  keymap[DIKI_G] = SDLK_g;
    1.14 -  keymap[DIKI_H] = SDLK_h;
    1.15 -  keymap[DIKI_I] = SDLK_i;
    1.16 -  keymap[DIKI_J] = SDLK_j;
    1.17 -  keymap[DIKI_K] = SDLK_k;
    1.18 -  keymap[DIKI_L] = SDLK_l;
    1.19 -  keymap[DIKI_M] = SDLK_m;
    1.20 -  keymap[DIKI_N] = SDLK_n;
    1.21 -  keymap[DIKI_O] = SDLK_o;
    1.22 -  keymap[DIKI_P] = SDLK_p;
    1.23 -  keymap[DIKI_Q] = SDLK_q;
    1.24 -  keymap[DIKI_R] = SDLK_r;
    1.25 -  keymap[DIKI_S] = SDLK_s;
    1.26 -  keymap[DIKI_T] = SDLK_t;
    1.27 -  keymap[DIKI_U] = SDLK_u;
    1.28 -  keymap[DIKI_V] = SDLK_v;
    1.29 -  keymap[DIKI_W] = SDLK_w;
    1.30 -  keymap[DIKI_X] = SDLK_x;
    1.31 -  keymap[DIKI_Y] = SDLK_y;
    1.32 -  keymap[DIKI_Z] = SDLK_z;
    1.33 +  keymap[DIKI_A - DIKI_UNKNOWN] = SDLK_a;
    1.34 +  keymap[DIKI_B - DIKI_UNKNOWN] = SDLK_b;
    1.35 +  keymap[DIKI_C - DIKI_UNKNOWN] = SDLK_c;
    1.36 +  keymap[DIKI_D - DIKI_UNKNOWN] = SDLK_d;
    1.37 +  keymap[DIKI_E - DIKI_UNKNOWN] = SDLK_e;
    1.38 +  keymap[DIKI_F - DIKI_UNKNOWN] = SDLK_f;
    1.39 +  keymap[DIKI_G - DIKI_UNKNOWN] = SDLK_g;
    1.40 +  keymap[DIKI_H - DIKI_UNKNOWN] = SDLK_h;
    1.41 +  keymap[DIKI_I - DIKI_UNKNOWN] = SDLK_i;
    1.42 +  keymap[DIKI_J - DIKI_UNKNOWN] = SDLK_j;
    1.43 +  keymap[DIKI_K - DIKI_UNKNOWN] = SDLK_k;
    1.44 +  keymap[DIKI_L - DIKI_UNKNOWN] = SDLK_l;
    1.45 +  keymap[DIKI_M - DIKI_UNKNOWN] = SDLK_m;
    1.46 +  keymap[DIKI_N - DIKI_UNKNOWN] = SDLK_n;
    1.47 +  keymap[DIKI_O - DIKI_UNKNOWN] = SDLK_o;
    1.48 +  keymap[DIKI_P - DIKI_UNKNOWN] = SDLK_p;
    1.49 +  keymap[DIKI_Q - DIKI_UNKNOWN] = SDLK_q;
    1.50 +  keymap[DIKI_R - DIKI_UNKNOWN] = SDLK_r;
    1.51 +  keymap[DIKI_S - DIKI_UNKNOWN] = SDLK_s;
    1.52 +  keymap[DIKI_T - DIKI_UNKNOWN] = SDLK_t;
    1.53 +  keymap[DIKI_U - DIKI_UNKNOWN] = SDLK_u;
    1.54 +  keymap[DIKI_V - DIKI_UNKNOWN] = SDLK_v;
    1.55 +  keymap[DIKI_W - DIKI_UNKNOWN] = SDLK_w;
    1.56 +  keymap[DIKI_X - DIKI_UNKNOWN] = SDLK_x;
    1.57 +  keymap[DIKI_Y - DIKI_UNKNOWN] = SDLK_y;
    1.58 +  keymap[DIKI_Z - DIKI_UNKNOWN] = SDLK_z;
    1.59    
    1.60 -  keymap[DIKI_0] = SDLK_0;
    1.61 -  keymap[DIKI_1] = SDLK_1;
    1.62 -  keymap[DIKI_2] = SDLK_2;
    1.63 -  keymap[DIKI_3] = SDLK_3;
    1.64 -  keymap[DIKI_4] = SDLK_4;
    1.65 -  keymap[DIKI_5] = SDLK_5;
    1.66 -  keymap[DIKI_6] = SDLK_6;
    1.67 -  keymap[DIKI_7] = SDLK_7;
    1.68 -  keymap[DIKI_8] = SDLK_8;
    1.69 -  keymap[DIKI_9] = SDLK_9;
    1.70 +  keymap[DIKI_0 - DIKI_UNKNOWN] = SDLK_0;
    1.71 +  keymap[DIKI_1 - DIKI_UNKNOWN] = SDLK_1;
    1.72 +  keymap[DIKI_2 - DIKI_UNKNOWN] = SDLK_2;
    1.73 +  keymap[DIKI_3 - DIKI_UNKNOWN] = SDLK_3;
    1.74 +  keymap[DIKI_4 - DIKI_UNKNOWN] = SDLK_4;
    1.75 +  keymap[DIKI_5 - DIKI_UNKNOWN] = SDLK_5;
    1.76 +  keymap[DIKI_6 - DIKI_UNKNOWN] = SDLK_6;
    1.77 +  keymap[DIKI_7 - DIKI_UNKNOWN] = SDLK_7;
    1.78 +  keymap[DIKI_8 - DIKI_UNKNOWN] = SDLK_8;
    1.79 +  keymap[DIKI_9 - DIKI_UNKNOWN] = SDLK_9;
    1.80    
    1.81 -  keymap[DIKI_F1] = SDLK_F1;
    1.82 -  keymap[DIKI_F2] = SDLK_F2;
    1.83 -  keymap[DIKI_F3] = SDLK_F3;
    1.84 -  keymap[DIKI_F4] = SDLK_F4;
    1.85 -  keymap[DIKI_F5] = SDLK_F5;
    1.86 -  keymap[DIKI_F6] = SDLK_F6;
    1.87 -  keymap[DIKI_F7] = SDLK_F7;
    1.88 -  keymap[DIKI_F8] = SDLK_F8;
    1.89 -  keymap[DIKI_F9] = SDLK_F9;
    1.90 -  keymap[DIKI_F10] = SDLK_F10;
    1.91 -  keymap[DIKI_F11] = SDLK_F11;
    1.92 -  keymap[DIKI_F12] = SDLK_F12;
    1.93 +  keymap[DIKI_F1 - DIKI_UNKNOWN] = SDLK_F1;
    1.94 +  keymap[DIKI_F2 - DIKI_UNKNOWN] = SDLK_F2;
    1.95 +  keymap[DIKI_F3 - DIKI_UNKNOWN] = SDLK_F3;
    1.96 +  keymap[DIKI_F4 - DIKI_UNKNOWN] = SDLK_F4;
    1.97 +  keymap[DIKI_F5 - DIKI_UNKNOWN] = SDLK_F5;
    1.98 +  keymap[DIKI_F6 - DIKI_UNKNOWN] = SDLK_F6;
    1.99 +  keymap[DIKI_F7 - DIKI_UNKNOWN] = SDLK_F7;
   1.100 +  keymap[DIKI_F8 - DIKI_UNKNOWN] = SDLK_F8;
   1.101 +  keymap[DIKI_F9 - DIKI_UNKNOWN] = SDLK_F9;
   1.102 +  keymap[DIKI_F10 - DIKI_UNKNOWN] = SDLK_F10;
   1.103 +  keymap[DIKI_F11 - DIKI_UNKNOWN] = SDLK_F11;
   1.104 +  keymap[DIKI_F12 - DIKI_UNKNOWN] = SDLK_F12;
   1.105    
   1.106 -  keymap[DIKI_ESCAPE] = SDLK_ESCAPE;
   1.107 -  keymap[DIKI_LEFT] = SDLK_LEFT;
   1.108 -  keymap[DIKI_RIGHT] = SDLK_RIGHT;
   1.109 -  keymap[DIKI_UP] = SDLK_UP;
   1.110 -  keymap[DIKI_DOWN] = SDLK_DOWN;
   1.111 -  keymap[DIKI_CONTROL_L] = SDLK_LCTRL;
   1.112 -  keymap[DIKI_CONTROL_R] = SDLK_RCTRL;
   1.113 -  keymap[DIKI_SHIFT_L] = SDLK_LSHIFT;
   1.114 -  keymap[DIKI_SHIFT_R] = SDLK_RSHIFT;
   1.115 -  keymap[DIKI_ALT_L] = SDLK_LALT;
   1.116 -  keymap[DIKI_ALTGR] = SDLK_RALT;
   1.117 -  keymap[DIKI_TAB] = SDLK_TAB;
   1.118 -  keymap[DIKI_ENTER] = SDLK_RETURN;
   1.119 -  keymap[DIKI_SPACE] = SDLK_SPACE;
   1.120 -  keymap[DIKI_BACKSPACE] = SDLK_BACKSPACE;
   1.121 -  keymap[DIKI_INSERT] = SDLK_INSERT;
   1.122 -  keymap[DIKI_DELETE] = SDLK_DELETE;
   1.123 -  keymap[DIKI_HOME] = SDLK_HOME;
   1.124 -  keymap[DIKI_END] = SDLK_END;
   1.125 -  keymap[DIKI_PAGE_UP] = SDLK_PAGEUP;
   1.126 -  keymap[DIKI_PAGE_DOWN] = SDLK_PAGEDOWN;
   1.127 -  keymap[DIKI_CAPS_LOCK] = SDLK_CAPSLOCK;
   1.128 -  keymap[DIKI_NUM_LOCK] = SDLK_NUMLOCK;
   1.129 -  keymap[DIKI_SCROLL_LOCK] = SDLK_SCROLLOCK;
   1.130 -  keymap[DIKI_PRINT] = SDLK_PRINT;
   1.131 -  keymap[DIKI_PAUSE] = SDLK_PAUSE;
   1.132 -  keymap[DIKI_KP_DIV] = SDLK_KP_DIVIDE;
   1.133 -  keymap[DIKI_KP_MULT] = SDLK_KP_MULTIPLY;
   1.134 -  keymap[DIKI_KP_MINUS] = SDLK_KP_MINUS;
   1.135 -  keymap[DIKI_KP_PLUS] = SDLK_KP_PLUS;
   1.136 -  keymap[DIKI_KP_ENTER] = SDLK_KP_ENTER;
   1.137 +  keymap[DIKI_ESCAPE - DIKI_UNKNOWN] = SDLK_ESCAPE;
   1.138 +  keymap[DIKI_LEFT - DIKI_UNKNOWN] = SDLK_LEFT;
   1.139 +  keymap[DIKI_RIGHT - DIKI_UNKNOWN] = SDLK_RIGHT;
   1.140 +  keymap[DIKI_UP - DIKI_UNKNOWN] = SDLK_UP;
   1.141 +  keymap[DIKI_DOWN - DIKI_UNKNOWN] = SDLK_DOWN;
   1.142 +  keymap[DIKI_CONTROL_L - DIKI_UNKNOWN] = SDLK_LCTRL;
   1.143 +  keymap[DIKI_CONTROL_R - DIKI_UNKNOWN] = SDLK_RCTRL;
   1.144 +  keymap[DIKI_SHIFT_L - DIKI_UNKNOWN] = SDLK_LSHIFT;
   1.145 +  keymap[DIKI_SHIFT_R - DIKI_UNKNOWN] = SDLK_RSHIFT;
   1.146 +  keymap[DIKI_ALT_L - DIKI_UNKNOWN] = SDLK_LALT;
   1.147 +  keymap[DIKI_ALTGR - DIKI_UNKNOWN] = SDLK_RALT;
   1.148 +  keymap[DIKI_TAB - DIKI_UNKNOWN] = SDLK_TAB;
   1.149 +  keymap[DIKI_ENTER - DIKI_UNKNOWN] = SDLK_RETURN;
   1.150 +  keymap[DIKI_SPACE - DIKI_UNKNOWN] = SDLK_SPACE;
   1.151 +  keymap[DIKI_BACKSPACE - DIKI_UNKNOWN] = SDLK_BACKSPACE;
   1.152 +  keymap[DIKI_INSERT - DIKI_UNKNOWN] = SDLK_INSERT;
   1.153 +  keymap[DIKI_DELETE - DIKI_UNKNOWN] = SDLK_DELETE;
   1.154 +  keymap[DIKI_HOME - DIKI_UNKNOWN] = SDLK_HOME;
   1.155 +  keymap[DIKI_END - DIKI_UNKNOWN] = SDLK_END;
   1.156 +  keymap[DIKI_PAGE_UP - DIKI_UNKNOWN] = SDLK_PAGEUP;
   1.157 +  keymap[DIKI_PAGE_DOWN - DIKI_UNKNOWN] = SDLK_PAGEDOWN;
   1.158 +  keymap[DIKI_CAPS_LOCK - DIKI_UNKNOWN] = SDLK_CAPSLOCK;
   1.159 +  keymap[DIKI_NUM_LOCK - DIKI_UNKNOWN] = SDLK_NUMLOCK;
   1.160 +  keymap[DIKI_SCROLL_LOCK - DIKI_UNKNOWN] = SDLK_SCROLLOCK;
   1.161 +  keymap[DIKI_PRINT - DIKI_UNKNOWN] = SDLK_PRINT;
   1.162 +  keymap[DIKI_PAUSE - DIKI_UNKNOWN] = SDLK_PAUSE;
   1.163 +  keymap[DIKI_KP_DIV - DIKI_UNKNOWN] = SDLK_KP_DIVIDE;
   1.164 +  keymap[DIKI_KP_MULT - DIKI_UNKNOWN] = SDLK_KP_MULTIPLY;
   1.165 +  keymap[DIKI_KP_MINUS - DIKI_UNKNOWN] = SDLK_KP_MINUS;
   1.166 +  keymap[DIKI_KP_PLUS - DIKI_UNKNOWN] = SDLK_KP_PLUS;
   1.167 +  keymap[DIKI_KP_ENTER - DIKI_UNKNOWN] = SDLK_KP_ENTER;
   1.168  }
   1.169  
   1.170  
   1.171 @@ -195,7 +195,7 @@
   1.172    if (ev->key_symbol > 0 && ev->key_symbol < 128)
   1.173      keysym->sym = ev->key_symbol;
   1.174    else
   1.175 -    keysym->sym = keymap[ev->key_id];
   1.176 +    keysym->sym = keymap[ev->key_id - DIKI_UNKNOWN];
   1.177  
   1.178    return keysym;
   1.179  }