include/SDL_scancode.h
changeset 3407 d3baf5ac4e37
parent 2859 99210400e8b9
child 3697 f7b03b6838cb
     1.1 --- a/include/SDL_scancode.h	Sun Oct 18 23:21:15 2009 +0000
     1.2 +++ b/include/SDL_scancode.h	Mon Oct 19 13:31:58 2009 +0000
     1.3 @@ -21,7 +21,9 @@
     1.4  */
     1.5  
     1.6  /**
     1.7 - * \file SDL_scancode.h
     1.8 + *  \file SDL_scancode.h
     1.9 + *  
    1.10 + *  Defines keyboard scancodes.
    1.11   */
    1.12  
    1.13  #ifndef _SDL_scancode_h
    1.14 @@ -30,22 +32,25 @@
    1.15  #include "SDL_stdinc.h"
    1.16  
    1.17  /**
    1.18 - * \enum SDL_scancode
    1.19 - *
    1.20 - * \brief The SDL keyboard scancode representation.
    1.21 - *
    1.22 - * Values of this type are used to represent keyboard keys, among other places
    1.23 - * in the \link SDL_keysym::scancode key.keysym.scancode \endlink field of the
    1.24 - * SDL_Event structure.
    1.25 - *
    1.26 - * The values in this enumeration are based on the USB usage page standard:
    1.27 - * http://www.usb.org/developers/devclass_docs/Hut1_12.pdf
    1.28 + *  \brief The SDL keyboard scancode representation.
    1.29 + *  
    1.30 + *  Values of this type are used to represent keyboard keys, among other places
    1.31 + *  in the \link SDL_keysym::scancode key.keysym.scancode \endlink field of the
    1.32 + *  SDL_Event structure.
    1.33 + *  
    1.34 + *  The values in this enumeration are based on the USB usage page standard:
    1.35 + *  http://www.usb.org/developers/devclass_docs/Hut1_12.pdf
    1.36   */
    1.37  typedef enum
    1.38  {
    1.39      SDL_SCANCODE_UNKNOWN = 0,
    1.40  
    1.41 -    /* These values are from usage page 0x07 (USB keyboard page) */
    1.42 +    /** 
    1.43 +     *  \name Usage page 0x07
    1.44 +     *  
    1.45 +     *  These values are from usage page 0x07 (USB keyboard page).
    1.46 +     */
    1.47 +    /*@{*/
    1.48  
    1.49      SDL_SCANCODE_A = 4,
    1.50      SDL_SCANCODE_B = 5,
    1.51 @@ -95,11 +100,51 @@
    1.52      SDL_SCANCODE_EQUALS = 46,
    1.53      SDL_SCANCODE_LEFTBRACKET = 47,
    1.54      SDL_SCANCODE_RIGHTBRACKET = 48,
    1.55 -    SDL_SCANCODE_BACKSLASH = 49, /**< Located at the lower left of the return key on ISO keyboards and at the right end of the QWERTY row on ANSI keyboards. Produces REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US layout, REVERSE SOLIDUS and VERTICAL LINE in a UK Mac layout, NUMBER SIGN and TILDE in a UK Windows layout, DOLLAR SIGN and POUND SIGN in a Swiss German layout, NUMBER SIGN and APOSTROPHE in a German layout, GRAVE ACCENT and POUND SIGN in a French Mac layout, and ASTERISK and MICRO SIGN in a French Windows layout. */
    1.56 -    SDL_SCANCODE_NONUSHASH = 50, /**< ISO USB keyboards actually use this code instead of 49 for the same key, but all OSes I've seen treat the two codes identically. So, as an implementor, unless your keyboard generates both of those codes and your OS treats them differently, you should generate SDL_SCANCODE_BACKSLASH instead of this code. As a user, you should not rely on this code because SDL will never generate it with most (all?) keyboards. */
    1.57 +    SDL_SCANCODE_BACKSLASH = 49, /**< Located at the lower left of the return 
    1.58 +                                  *   key on ISO keyboards and at the right end 
    1.59 +                                  *   of the QWERTY row on ANSI keyboards. 
    1.60 +                                  *   Produces REVERSE SOLIDUS (backslash) and 
    1.61 +                                  *   VERTICAL LINE in a US layout, REVERSE 
    1.62 +                                  *   SOLIDUS and VERTICAL LINE in a UK Mac 
    1.63 +                                  *   layout, NUMBER SIGN and TILDE in a UK 
    1.64 +                                  *   Windows layout, DOLLAR SIGN and POUND SIGN
    1.65 +                                  *   in a Swiss German layout, NUMBER SIGN and 
    1.66 +                                  *   APOSTROPHE in a German layout, GRAVE 
    1.67 +                                  *   ACCENT and POUND SIGN in a French Mac 
    1.68 +                                  *   layout, and ASTERISK and MICRO SIGN in a 
    1.69 +                                  *   French Windows layout.
    1.70 +                                  */
    1.71 +    SDL_SCANCODE_NONUSHASH = 50, /**< ISO USB keyboards actually use this code 
    1.72 +                                  *   instead of 49 for the same key, but all 
    1.73 +                                  *   OSes I've seen treat the two codes 
    1.74 +                                  *   identically. So, as an implementor, unless
    1.75 +                                  *   your keyboard generates both of those 
    1.76 +                                  *   codes and your OS treats them differently,
    1.77 +                                  *   you should generate SDL_SCANCODE_BACKSLASH
    1.78 +                                  *   instead of this code. As a user, you 
    1.79 +                                  *   should not rely on this code because SDL 
    1.80 +                                  *   will never generate it with most (all?) 
    1.81 +                                  *   keyboards. 
    1.82 +                                  */
    1.83      SDL_SCANCODE_SEMICOLON = 51,
    1.84      SDL_SCANCODE_APOSTROPHE = 52,
    1.85 -    SDL_SCANCODE_GRAVE = 53, /**< Located in the top left corner (on both ANSI and ISO keyboards). Produces GRAVE ACCENT and TILDE in a US Windows layout and in US and UK Mac layouts on ANSI keyboards, GRAVE ACCENT and NOT SIGN in a UK Windows layout, SECTION SIGN and PLUS-MINUS SIGN in US and UK Mac layouts on ISO keyboards, SECTION SIGN and DEGREE SIGN in a Swiss German layout (Mac: only on ISO keyboards), CIRCUMFLEX ACCENT and DEGREE SIGN in a German layout (Mac: only on ISO keyboards), SUPERSCRIPT TWO and TILDE in a French Windows layout, COMMERCIAL AT and NUMBER SIGN in a French Mac layout on ISO keyboards, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French Mac layout on ANSI keyboards. */
    1.86 +    SDL_SCANCODE_GRAVE = 53, /**< Located in the top left corner (on both ANSI 
    1.87 +                              *   and ISO keyboards). Produces GRAVE ACCENT and 
    1.88 +                              *   TILDE in a US Windows layout and in US and UK 
    1.89 +                              *   Mac layouts on ANSI keyboards, GRAVE ACCENT 
    1.90 +                              *   and NOT SIGN in a UK Windows layout, SECTION 
    1.91 +                              *   SIGN and PLUS-MINUS SIGN in US and UK Mac 
    1.92 +                              *   layouts on ISO keyboards, SECTION SIGN and 
    1.93 +                              *   DEGREE SIGN in a Swiss German layout (Mac: 
    1.94 +                              *   only on ISO keyboards), CIRCUMFLEX ACCENT and 
    1.95 +                              *   DEGREE SIGN in a German layout (Mac: only on 
    1.96 +                              *   ISO keyboards), SUPERSCRIPT TWO and TILDE in a
    1.97 +                              *   French Windows layout, COMMERCIAL AT and 
    1.98 +                              *   NUMBER SIGN in a French Mac layout on ISO 
    1.99 +                              *   keyboards, and LESS-THAN SIGN and GREATER-THAN
   1.100 +                              *   SIGN in a Swiss German, German, or French Mac 
   1.101 +                              *   layout on ANSI keyboards.
   1.102 +                              */
   1.103      SDL_SCANCODE_COMMA = 54,
   1.104      SDL_SCANCODE_PERIOD = 55,
   1.105      SDL_SCANCODE_SLASH = 56,
   1.106 @@ -122,7 +167,8 @@
   1.107      SDL_SCANCODE_PRINTSCREEN = 70,
   1.108      SDL_SCANCODE_SCROLLLOCK = 71,
   1.109      SDL_SCANCODE_PAUSE = 72,
   1.110 -    SDL_SCANCODE_INSERT = 73, /**< insert on PC, help on some Mac keyboards (but does send code 73, not 117) */
   1.111 +    SDL_SCANCODE_INSERT = 73, /**< insert on PC, help on some Mac keyboards (but
   1.112 +                                   does send code 73, not 117) */
   1.113      SDL_SCANCODE_HOME = 74,
   1.114      SDL_SCANCODE_PAGEUP = 75,
   1.115      SDL_SCANCODE_DELETE = 76,
   1.116 @@ -133,7 +179,8 @@
   1.117      SDL_SCANCODE_DOWN = 81,
   1.118      SDL_SCANCODE_UP = 82,
   1.119  
   1.120 -    SDL_SCANCODE_NUMLOCKCLEAR = 83, /**< num lock on PC, clear on Mac keyboards */
   1.121 +    SDL_SCANCODE_NUMLOCKCLEAR = 83, /**< num lock on PC, clear on Mac keyboards 
   1.122 +                                     */
   1.123      SDL_SCANCODE_KP_DIVIDE = 84,
   1.124      SDL_SCANCODE_KP_MULTIPLY = 85,
   1.125      SDL_SCANCODE_KP_MINUS = 86,
   1.126 @@ -151,9 +198,20 @@
   1.127      SDL_SCANCODE_KP_0 = 98,
   1.128      SDL_SCANCODE_KP_PERIOD = 99,
   1.129  
   1.130 -    SDL_SCANCODE_NONUSBACKSLASH = 100, /**< This is the additional key that ISO keyboards have over ANSI ones, located between left shift and Y. Produces GRAVE ACCENT and TILDE in a US or UK Mac layout, REVERSE SOLIDUS (backslash) and VERTICAL LINE in a US or UK Windows layout, and LESS-THAN SIGN and GREATER-THAN SIGN in a Swiss German, German, or French layout. */
   1.131 +    SDL_SCANCODE_NONUSBACKSLASH = 100, /**< This is the additional key that ISO 
   1.132 +                                        *   keyboards have over ANSI ones, 
   1.133 +                                        *   located between left shift and Y. 
   1.134 +                                        *   Produces GRAVE ACCENT and TILDE in a
   1.135 +                                        *   US or UK Mac layout, REVERSE SOLIDUS
   1.136 +                                        *   (backslash) and VERTICAL LINE in a 
   1.137 +                                        *   US or UK Windows layout, and 
   1.138 +                                        *   LESS-THAN SIGN and GREATER-THAN SIGN
   1.139 +                                        *   in a Swiss German, German, or French
   1.140 +                                        *   layout. */
   1.141      SDL_SCANCODE_APPLICATION = 101, /**< windows contextual menu, compose */
   1.142 -    SDL_SCANCODE_POWER = 102, /**< The USB document says this is a status flag, not a physical key - but some Mac keyboards do have a power key. */
   1.143 +    SDL_SCANCODE_POWER = 102, /**< The USB document says this is a status flag, 
   1.144 +                               *   not a physical key - but some Mac keyboards 
   1.145 +                               *   do have a power key. */
   1.146      SDL_SCANCODE_KP_EQUALS = 103,
   1.147      SDL_SCANCODE_F13 = 104,
   1.148      SDL_SCANCODE_F14 = 105,
   1.149 @@ -172,7 +230,7 @@
   1.150      SDL_SCANCODE_MENU = 118,
   1.151      SDL_SCANCODE_SELECT = 119,
   1.152      SDL_SCANCODE_STOP = 120,
   1.153 -    SDL_SCANCODE_AGAIN = 121,   /*!< redo */
   1.154 +    SDL_SCANCODE_AGAIN = 121,   /**< redo */
   1.155      SDL_SCANCODE_UNDO = 122,
   1.156      SDL_SCANCODE_CUT = 123,
   1.157      SDL_SCANCODE_COPY = 124,
   1.158 @@ -188,7 +246,8 @@
   1.159      SDL_SCANCODE_KP_COMMA = 133,
   1.160      SDL_SCANCODE_KP_EQUALSAS400 = 134,
   1.161  
   1.162 -    SDL_SCANCODE_INTERNATIONAL1 = 135, /**< used on Asian keyboards, see footnotes in USB doc */
   1.163 +    SDL_SCANCODE_INTERNATIONAL1 = 135, /**< used on Asian keyboards, see 
   1.164 +                                            footnotes in USB doc */
   1.165      SDL_SCANCODE_INTERNATIONAL2 = 136,
   1.166      SDL_SCANCODE_INTERNATIONAL3 = 137, /**< Yen */
   1.167      SDL_SCANCODE_INTERNATIONAL4 = 138,
   1.168 @@ -276,9 +335,19 @@
   1.169      SDL_SCANCODE_RALT = 230, /**< alt gr, option */
   1.170      SDL_SCANCODE_RGUI = 231, /**< windows, command (apple), meta */
   1.171  
   1.172 -    SDL_SCANCODE_MODE = 257,    /* I'm not sure if this is really not covered by any of the above, but since there's a special KMOD_MODE for it I'm adding it here */
   1.173 +    SDL_SCANCODE_MODE = 257,    /**< I'm not sure if this is really not covered 
   1.174 +                                 *   by any of the above, but since there's a 
   1.175 +                                 *   special KMOD_MODE for it I'm adding it here
   1.176 +                                 */
   1.177 +    
   1.178 +    /*@}*//*Usage page 0x07*/
   1.179  
   1.180 -    /* These values are mapped from usage page 0x0C (USB consumer page) */
   1.181 +    /**
   1.182 +     *  \name Usage page 0x0C
   1.183 +     *  
   1.184 +     *  These values are mapped from usage page 0x0C (USB consumer page).
   1.185 +     */
   1.186 +    /*@{*/
   1.187  
   1.188      SDL_SCANCODE_AUDIONEXT = 258,
   1.189      SDL_SCANCODE_AUDIOPREV = 259,
   1.190 @@ -297,21 +366,32 @@
   1.191      SDL_SCANCODE_AC_STOP = 272,
   1.192      SDL_SCANCODE_AC_REFRESH = 273,
   1.193      SDL_SCANCODE_AC_BOOKMARKS = 274,
   1.194 +    
   1.195 +    /*@}*//*Usage page 0x0C*/
   1.196  
   1.197 -    /* These are values that Christian Walther added (for mac keyboard?) */
   1.198 +    /**
   1.199 +     *  \name Walther keys
   1.200 +     *  
   1.201 +     *  These are values that Christian Walther added (for mac keyboard?).
   1.202 +     */
   1.203 +    /*@{*/
   1.204  
   1.205      SDL_SCANCODE_BRIGHTNESSDOWN = 275,
   1.206      SDL_SCANCODE_BRIGHTNESSUP = 276,
   1.207 -    SDL_SCANCODE_DISPLAYSWITCH = 277, /**< display mirroring/dual display switch, video mode switch */
   1.208 +    SDL_SCANCODE_DISPLAYSWITCH = 277, /**< display mirroring/dual display 
   1.209 +                                           switch, video mode switch */
   1.210      SDL_SCANCODE_KBDILLUMTOGGLE = 278,
   1.211      SDL_SCANCODE_KBDILLUMDOWN = 279,
   1.212      SDL_SCANCODE_KBDILLUMUP = 280,
   1.213      SDL_SCANCODE_EJECT = 281,
   1.214      SDL_SCANCODE_SLEEP = 282,
   1.215 +    
   1.216 +    /*@}*//*Walther keys*/
   1.217  
   1.218 -    /* Add any other keys here */
   1.219 +    /* Add any other keys here. */
   1.220  
   1.221 -    SDL_NUM_SCANCODES = 512 /**< (not a key, just marks the number of scancodes for array bounds) */
   1.222 +    SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes 
   1.223 +                                 for array bounds */
   1.224  } SDL_scancode;
   1.225  
   1.226  #endif /* _SDL_scancode_h */