include/SDL_compat.h
changeset 2303 d87417504c75
parent 2295 dbc6d1893869
child 2328 91e601d9df8b
     1.1 --- a/include/SDL_compat.h	Mon Feb 04 17:25:33 2008 +0000
     1.2 +++ b/include/SDL_compat.h	Tue Feb 05 07:19:23 2008 +0000
     1.3 @@ -130,47 +130,54 @@
     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 +/* Obsolete or renamed key codes */
    1.18  
    1.19 -/* These key constants were renamed for clarity or consistence. */
    1.20 -#define SDLK_QUOTE SDLK_APOSTROPHE
    1.21 -#define SDLK_MINUS SDLK_HYPHENMINUS
    1.22 -#define SDLK_BACKQUOTE SDLK_GRAVE
    1.23 -#define SDLK_a SDLK_A
    1.24 -#define SDLK_b SDLK_B
    1.25 -#define SDLK_c SDLK_C
    1.26 -#define SDLK_d SDLK_D
    1.27 -#define SDLK_e SDLK_E
    1.28 -#define SDLK_f SDLK_F
    1.29 -#define SDLK_g SDLK_G
    1.30 -#define SDLK_h SDLK_H
    1.31 -#define SDLK_i SDLK_I
    1.32 -#define SDLK_j SDLK_J
    1.33 -#define SDLK_k SDLK_K
    1.34 -#define SDLK_l SDLK_L
    1.35 -#define SDLK_m SDLK_M
    1.36 -#define SDLK_n SDLK_N
    1.37 -#define SDLK_o SDLK_O
    1.38 -#define SDLK_p SDLK_P
    1.39 -#define SDLK_q SDLK_Q
    1.40 -#define SDLK_r SDLK_R
    1.41 -#define SDLK_s SDLK_S
    1.42 -#define SDLK_t SDLK_T
    1.43 -#define SDLK_u SDLK_U
    1.44 -#define SDLK_v SDLK_V
    1.45 -#define SDLK_w SDLK_W
    1.46 -#define SDLK_x SDLK_X
    1.47 -#define SDLK_y SDLK_Y
    1.48 -#define SDLK_z SDLK_Z
    1.49 +/* These key constants were renamed for clarity or consistency. */
    1.50 +#define SDLK_a  'a'
    1.51 +#define SDLK_b  'b'
    1.52 +#define SDLK_c  'c'
    1.53 +#define SDLK_d  'd'
    1.54 +#define SDLK_e  'e'
    1.55 +#define SDLK_f  'f'
    1.56 +#define SDLK_g  'g'
    1.57 +#define SDLK_h  'h'
    1.58 +#define SDLK_i  'i'
    1.59 +#define SDLK_j  'j'
    1.60 +#define SDLK_k  'k'
    1.61 +#define SDLK_l  'l'
    1.62 +#define SDLK_m  'm'
    1.63 +#define SDLK_n  'n'
    1.64 +#define SDLK_o  'o'
    1.65 +#define SDLK_p  'p'
    1.66 +#define SDLK_q  'q'
    1.67 +#define SDLK_r  'r'
    1.68 +#define SDLK_s  's'
    1.69 +#define SDLK_t  't'
    1.70 +#define SDLK_u  'u'
    1.71 +#define SDLK_v  'v'
    1.72 +#define SDLK_w  'w'
    1.73 +#define SDLK_x  'x'
    1.74 +#define SDLK_y  'y'
    1.75 +#define SDLK_z  'z'
    1.76 +#define SDLK_QUOTE      '\''
    1.77 +#define SDLK_MINUS      '-'
    1.78 +#define SDLK_BACKQUOTE  '`'
    1.79 +#define SDLK_EXCLAIM    '!'
    1.80 +#define SDLK_QUOTEDBL   '"'
    1.81 +#define SDLK_HASH       '#'
    1.82 +#define SDLK_DOLLAR     '$'
    1.83 +#define SDLK_AMPERSAND  '&'
    1.84 +#define SDLK_LEFTPAREN  '('
    1.85 +#define SDLK_RIGHTPAREN ')'
    1.86 +#define SDLK_ASTERISK   '*'
    1.87 +#define SDLK_PLUS       '+'
    1.88 +#define SDLK_COLON      ':'
    1.89 +#define SDLK_LESS       '<'
    1.90 +#define SDLK_GREATER    '>'
    1.91 +#define SDLK_QUESTION   '?'
    1.92 +#define SDLK_AT         '@'
    1.93 +#define SDLK_CARET      '^'
    1.94 +#define SDLK_UNDERSCORE '_'
    1.95  #define SDLK_KP0 SDLK_KP_0
    1.96  #define SDLK_KP1 SDLK_KP_1
    1.97  #define SDLK_KP2 SDLK_KP_2
    1.98 @@ -181,30 +188,14 @@
    1.99  #define SDLK_KP7 SDLK_KP_7
   1.100  #define SDLK_KP8 SDLK_KP_8
   1.101  #define SDLK_KP9 SDLK_KP_9
   1.102 -#define SDLK_NUMLOCK SDLK_KP_NUMLOCKCLEAR
   1.103 +#define SDLK_NUMLOCK SDLK_NUMLOCKCLEAR
   1.104  #define SDLK_SCROLLOCK SDLK_SCROLLLOCK
   1.105  #define SDLK_PRINT SDLK_PRINTSCREEN
   1.106  
   1.107 -/* These key constants are obsoleted by the new keyboard handling,
   1.108 -   their definitions here correspond to how they appear on a US
   1.109 -   keyboard. */
   1.110 -
   1.111 -#define SDLK_EXCLAIM SDLK_1
   1.112 -#define SDLK_QUOTEDBL SDLK_APOSTROPHE
   1.113 -#define SDLK_HASH SDLK_3
   1.114 -#define SDLK_DOLLAR SDLK_4
   1.115 -#define SDLK_AMPERSAND SDLK_7
   1.116 -#define SDLK_LEFTPAREN SDLK_9
   1.117 -#define SDLK_RIGHTPAREN SDLK_0
   1.118 -#define SDLK_ASTERISK SDLK_8
   1.119 -#define SDLK_PLUS SDLK_EQUALS
   1.120 -#define SDLK_COLON SDLK_SEMICOLON
   1.121 -#define SDLK_LESS SDLK_COMMA
   1.122 -#define SDLK_GREATER SDLK_PERIOD
   1.123 -#define SDLK_QUESTION SDLK_SLASH
   1.124 -#define SDLK_AT SDLK_2
   1.125 -#define SDLK_CARET SDLK_6
   1.126 -#define SDLK_UNDERSCORE SDLK_HYPHENMINUS
   1.127 +/* The META modifier is equivalent to the GUI modifier from the USB standard */
   1.128 +#define KMOD_LMETA KMOD_LGUI
   1.129 +#define KMOD_RMETA KMOD_RGUI
   1.130 +#define KMOD_META KMOD_GUI
   1.131  
   1.132  /* 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.133  #define SDLK_LSUPER SDLK_LMETA
   1.134 @@ -268,6 +259,7 @@
   1.135  extern DECLSPEC void SDLCALL SDL_GL_SwapBuffers(void);
   1.136  extern DECLSPEC int SDLCALL SDL_EnableKeyRepeat(int delay, int interval);
   1.137  extern DECLSPEC void SDLCALL SDL_GetKeyRepeat(int *delay, int *interval);
   1.138 +extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable);
   1.139  
   1.140  /* Ends C function definitions when using C++ */
   1.141  #ifdef __cplusplus