include/SDL_gamecontroller.h
changeset 6964 c8aa24f05042
parent 6932 361bebe92c66
child 7061 45df4552bdfe
     1.1 --- a/include/SDL_gamecontroller.h	Mon Mar 04 20:27:51 2013 -0800
     1.2 +++ b/include/SDL_gamecontroller.h	Tue Mar 05 17:59:36 2013 -0500
     1.3 @@ -90,7 +90,7 @@
     1.4   *		}
     1.5   *  }
     1.6   *
     1.7 - *  Using the SDL_HINT_GAMECONTROLLERCONFIG hint you can add support for controllers SDL is unaware of or cause an existing controller to have a different binding. The format is:
     1.8 + *  Using the SDL_HINT_GAMECONTROLLERCONFIG hint or the SDL_GameControllerAddMapping you can add support for controllers SDL is unaware of or cause an existing controller to have a different binding. The format is:
     1.9   *	guid,name,mappings
    1.10   *
    1.11   *  Where GUID is the string value from SDL_JoystickGetGUIDString(), name is the human readable string for the device and mappings are controller mappings to joystick ones.
    1.12 @@ -106,6 +106,26 @@
    1.13   *
    1.14   */
    1.15  
    1.16 +/**
    1.17 + *  Add or update an existing mapping configuration
    1.18 + *
    1.19 + * \return 1 if mapping is added, 0 if updated, -1 on error
    1.20 + */
    1.21 +extern DECLSPEC int SDLCALL SDL_GameControllerAddMapping( const char* mappingSring );
    1.22 +
    1.23 +/**
    1.24 + *  Get a mapping string for a GUID
    1.25 + *
    1.26 + *  \return the mapping string.  Must be freed with SDL_free.  Returns NULL if no mapping is available
    1.27 + */
    1.28 +extern DECLSPEC char * SDLCALL SDL_GameControllerMappingForGUID( SDL_JoystickGUID guid );
    1.29 +
    1.30 +/**
    1.31 + *  Get a mapping string for an open GameController
    1.32 + *
    1.33 + *  \return the mapping string.  Must be freed with SDL_free.  Returns NULL if no mapping is available
    1.34 + */
    1.35 +extern DECLSPEC char * SDLCALL SDL_GameControllerMapping( SDL_GameController * gamecontroller );
    1.36  
    1.37  /**
    1.38   *  Is the joystick on this index supported by the game controller interface?
    1.39 @@ -187,6 +207,11 @@
    1.40  extern DECLSPEC SDL_GameControllerAxis SDLCALL SDL_GameControllerGetAxisFromString(const char *pchString);
    1.41  
    1.42  /**
    1.43 + *  turn this axis enum into a string mapping
    1.44 + */
    1.45 +extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForAxis(SDL_GameControllerAxis axis);
    1.46 +
    1.47 +/**
    1.48   *  Get the SDL joystick layer binding for this controller button mapping
    1.49   */
    1.50  extern DECLSPEC SDL_GameControllerButtonBind SDLCALL
    1.51 @@ -233,6 +258,10 @@
    1.52   */
    1.53  extern DECLSPEC SDL_GameControllerButton SDLCALL SDL_GameControllerGetButtonFromString(const char *pchString);
    1.54  
    1.55 +/**
    1.56 + *  turn this button enum into a string mapping
    1.57 + */
    1.58 +extern DECLSPEC const char* SDLCALL SDL_GameControllerGetStringForButton(SDL_GameControllerButton button);
    1.59  
    1.60  /**
    1.61   *  Get the SDL joystick layer binding for this controller button mapping