include/SDL_keyboard.h
changeset 6029 4a8bbaa52b9b
parent 5535 96594ac5fd1a
child 6138 4c64952a58fb
     1.1 --- a/include/SDL_keyboard.h	Mon Oct 24 23:00:09 2011 -0400
     1.2 +++ b/include/SDL_keyboard.h	Mon Oct 24 21:34:54 2011 -0400
     1.3 @@ -111,15 +111,22 @@
     1.4  /**
     1.5   *  \brief Get a human-readable name for a scancode.
     1.6   *  
     1.7 - *  \return A pointer to a UTF-8 string that stays valid at least until the next
     1.8 - *          call to this function. If you need it around any longer, you must 
     1.9 - *          copy it.  If the scancode doesn't have a name, this function returns
    1.10 + *  \return A pointer to the name for the scancode.
    1.11 + *          If the scancode doesn't have a name, this function returns
    1.12   *          an empty string ("").
    1.13   *
    1.14   *  \sa SDL_Scancode
    1.15   */
    1.16 -extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode
    1.17 -                                                        scancode);
    1.18 +extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode scancode);
    1.19 +
    1.20 +/**
    1.21 + *  \brief Get a scancode from a human-readable name
    1.22 + *  
    1.23 + *  \return scancode, or SDL_SCANCODE_UNKNOWN if the name wasn't recognized
    1.24 + *
    1.25 + *  \sa SDL_Scancode
    1.26 + */
    1.27 +extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromName(const char *name);
    1.28  
    1.29  /**
    1.30   *  \brief Get a human-readable name for a key.
    1.31 @@ -134,6 +141,15 @@
    1.32  extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key);
    1.33  
    1.34  /**
    1.35 + *  \brief Get a key code from a human-readable name
    1.36 + *  
    1.37 + *  \return key code, or SDLK_UNKNOWN if the name wasn't recognized
    1.38 + *
    1.39 + *  \sa SDL_Keycode
    1.40 + */
    1.41 +extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromName(const char *name);
    1.42 +
    1.43 +/**
    1.44   *  \brief Start accepting Unicode text input events.
    1.45   *  
    1.46   *  \sa SDL_StopTextInput()