include/SDL_compat.h
changeset 2268 4baee598306d
parent 2267 c785543d1843
child 2295 dbc6d1893869
     1.1 --- a/include/SDL_compat.h	Sat Aug 18 05:39:09 2007 +0000
     1.2 +++ b/include/SDL_compat.h	Sun Aug 19 14:52:52 2007 +0000
     1.3 @@ -130,6 +130,87 @@
     1.4  
     1.5  struct SDL_SysWMinfo;
     1.6  
     1.7 +/* Key codes
     1.8 +   Note that the correspondences defined here are approximate at best because
     1.9 +   the meaning of the event structure field that carries these values has
    1.10 +   changed: in SDL 1.2, it referred to the key's label in the current keyboard
    1.11 +   layout, whereas now it refers to a specific physical key on the keyboard,
    1.12 +   regardless of the keyboard layout setting.
    1.13 +   To get comparable behavior to SDL 1.2, code that uses any of the codes below
    1.14 +   in ways like "if (somekey == SDLK_EXCLAIM)" should be changed to the
    1.15 +   equivalent of "if (SDL_GetLayoutKey(somekey) == '!')".
    1.16 + */
    1.17 +
    1.18 +/* These key constants were renamed for clarity or consistence. */
    1.19 +#define SDLK_QUOTE SDLK_APOSTROPHE
    1.20 +#define SDLK_MINUS SDLK_HYPHENMINUS
    1.21 +#define SDLK_BACKQUOTE SDLK_GRAVE
    1.22 +#define SDLK_a SDLK_A
    1.23 +#define SDLK_b SDLK_B
    1.24 +#define SDLK_c SDLK_C
    1.25 +#define SDLK_d SDLK_D
    1.26 +#define SDLK_e SDLK_E
    1.27 +#define SDLK_f SDLK_F
    1.28 +#define SDLK_g SDLK_G
    1.29 +#define SDLK_h SDLK_H
    1.30 +#define SDLK_i SDLK_I
    1.31 +#define SDLK_j SDLK_J
    1.32 +#define SDLK_k SDLK_K
    1.33 +#define SDLK_l SDLK_L
    1.34 +#define SDLK_m SDLK_M
    1.35 +#define SDLK_n SDLK_N
    1.36 +#define SDLK_o SDLK_O
    1.37 +#define SDLK_p SDLK_P
    1.38 +#define SDLK_q SDLK_Q
    1.39 +#define SDLK_r SDLK_R
    1.40 +#define SDLK_s SDLK_S
    1.41 +#define SDLK_t SDLK_T
    1.42 +#define SDLK_u SDLK_U
    1.43 +#define SDLK_v SDLK_V
    1.44 +#define SDLK_w SDLK_W
    1.45 +#define SDLK_x SDLK_X
    1.46 +#define SDLK_y SDLK_Y
    1.47 +#define SDLK_z SDLK_Z
    1.48 +#define SDLK_KP0 SDLK_KP_0
    1.49 +#define SDLK_KP1 SDLK_KP_1
    1.50 +#define SDLK_KP2 SDLK_KP_2
    1.51 +#define SDLK_KP3 SDLK_KP_3
    1.52 +#define SDLK_KP4 SDLK_KP_4
    1.53 +#define SDLK_KP5 SDLK_KP_5
    1.54 +#define SDLK_KP6 SDLK_KP_6
    1.55 +#define SDLK_KP7 SDLK_KP_7
    1.56 +#define SDLK_KP8 SDLK_KP_8
    1.57 +#define SDLK_KP9 SDLK_KP_9
    1.58 +#define SDLK_NUMLOCK SDLK_KP_NUMLOCKCLEAR
    1.59 +#define SDLK_SCROLLOCK SDLK_SCROLLLOCK
    1.60 +#define SDLK_PRINT SDLK_PRINTSCREEN
    1.61 +
    1.62 +/* These key constants are obsoleted the new keyboard handling, their definitions here correspond to how they appear on a US keyboard. */
    1.63 +#define SDLK_EXCLAIM SDLK_1
    1.64 +#define SDLK_QUOTEDBL SDLK_APOSTROPHE
    1.65 +#define SDLK_HASH SDLK_3
    1.66 +#define SDLK_DOLLAR SDLK_4
    1.67 +#define SDLK_AMPERSAND SDLK_7
    1.68 +#define SDLK_LEFTPAREN SDLK_9
    1.69 +#define SDLK_RIGHTPAREN SDLK_0
    1.70 +#define SDLK_ASTERISK SDLK_8
    1.71 +#define SDLK_PLUS SDLK_EQUALS
    1.72 +#define SDLK_COLON SDLK_SEMICOLON
    1.73 +#define SDLK_LESS SDLK_COMMA
    1.74 +#define SDLK_GREATER SDLK_PERIOD
    1.75 +#define SDLK_QUESTION SDLK_SLASH
    1.76 +#define SDLK_AT SDLK_2
    1.77 +#define SDLK_CARET SDLK_6
    1.78 +#define SDLK_UNDERSCORE SDLK_HYPHENMINUS
    1.79 +
    1.80 +/* These keys don't appear in the USB specification (or at least not under those names). I'm unsure if the following assignments make sense or if these codes should be defined as actual additional SDLK_ constants. */
    1.81 +#define SDLK_LSUPER SDLK_LMETA
    1.82 +#define SDLK_RSUPER SDLK_RMETA
    1.83 +#define SDLK_COMPOSE SDLK_APPLICATION
    1.84 +#define SDLK_BREAK SDLK_STOP
    1.85 +#define SDLK_EURO SDLK_2
    1.86 +
    1.87 +
    1.88  #define SDL_SetModuleHandle(x)
    1.89  #define SDL_AllocSurface    SDL_CreateRGBSurface
    1.90