include/SDL_keyboard.h
changeset 6029 4a8bbaa52b9b
parent 5535 96594ac5fd1a
child 6138 4c64952a58fb
equal deleted inserted replaced
6028:869b6723e1fc 6029:4a8bbaa52b9b
   109 extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key);
   109 extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key);
   110 
   110 
   111 /**
   111 /**
   112  *  \brief Get a human-readable name for a scancode.
   112  *  \brief Get a human-readable name for a scancode.
   113  *  
   113  *  
   114  *  \return A pointer to a UTF-8 string that stays valid at least until the next
   114  *  \return A pointer to the name for the scancode.
   115  *          call to this function. If you need it around any longer, you must 
   115  *          If the scancode doesn't have a name, this function returns
   116  *          copy it.  If the scancode doesn't have a name, this function returns
       
   117  *          an empty string ("").
   116  *          an empty string ("").
   118  *
   117  *
   119  *  \sa SDL_Scancode
   118  *  \sa SDL_Scancode
   120  */
   119  */
   121 extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode
   120 extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode scancode);
   122                                                         scancode);
   121 
       
   122 /**
       
   123  *  \brief Get a scancode from a human-readable name
       
   124  *  
       
   125  *  \return scancode, or SDL_SCANCODE_UNKNOWN if the name wasn't recognized
       
   126  *
       
   127  *  \sa SDL_Scancode
       
   128  */
       
   129 extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *name);
   123 
   130 
   124 /**
   131 /**
   125  *  \brief Get a human-readable name for a key.
   132  *  \brief Get a human-readable name for a key.
   126  *  
   133  *  
   127  *  \return A pointer to a UTF-8 string that stays valid at least until the next
   134  *  \return A pointer to a UTF-8 string that stays valid at least until the next
   130  *          empty string ("").
   137  *          empty string ("").
   131  *  
   138  *  
   132  *  \sa SDL_Key
   139  *  \sa SDL_Key
   133  */
   140  */
   134 extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key);
   141 extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key);
       
   142 
       
   143 /**
       
   144  *  \brief Get a key code from a human-readable name
       
   145  *  
       
   146  *  \return key code, or SDLK_UNKNOWN if the name wasn't recognized
       
   147  *
       
   148  *  \sa SDL_Keycode
       
   149  */
       
   150 extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name);
   135 
   151 
   136 /**
   152 /**
   137  *  \brief Start accepting Unicode text input events.
   153  *  \brief Start accepting Unicode text input events.
   138  *  
   154  *  
   139  *  \sa SDL_StopTextInput()
   155  *  \sa SDL_StopTextInput()