The XInput code is only available in the DirectInput joystick driver.
This commit is contained in:
parent
27d81d93e4
commit
86e0e26475
2 changed files with 5 additions and 5 deletions
|
@ -81,7 +81,7 @@ typedef struct _ControllerMapping_t
|
|||
/* default mappings we support */
|
||||
const char *s_ControllerMappings [] =
|
||||
{
|
||||
#ifdef __WIN32__
|
||||
#ifdef SDL_JOYSTICK_DINPUT
|
||||
"xinput,X360 Controller,a:b10,b:b11,y:b13,x:b12,start:b4,guide:b14,back:b5,dpup:b0,dpleft:b2,dpdown:b1,dpright:b3,leftshoulder:b8,rightshoulder:b9,leftstick:b6,rightstick:b7,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:a4,righttrigger:a5",
|
||||
"341a3608000000000000504944564944,Afterglow PS3 Controller,a:b1,b:b2,y:b3,x:b0,start:b9,guide:b12,back:b8,dpup:h0.1,dpleft:h0.8,dpdown:h0.4,dpright:h0.2,leftshoulder:b4,rightshoulder:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a2,righty:a3,lefttrigger:b6,righttrigger:b7",
|
||||
"88880803000000000000504944564944,PS3,a:b2,b:b1,x:b0,y:b3,start:b11,back:b8,leftstick:b9,rightstick:b10,leftshoulder:b4,rightshoulder:b5,dpup:h0.1,dpleft:h0.4,dpdown:h0.8,dpright:h0.2,leftx:a0,lefty:a1,rightx:a3,righty:a4,lefttrigger:b6,righttrigger:b7,guide:b12",
|
||||
|
@ -235,7 +235,7 @@ int SDL_GameControllerEventWatcher(void *userdata, SDL_Event * event)
|
|||
*/
|
||||
ControllerMapping_t *SDL_PrivateGetControllerMapping(int device_index)
|
||||
{
|
||||
#ifdef __WIN32__
|
||||
#ifdef SDL_JOYSTICK_DINPUT
|
||||
if ( SDL_SYS_IsXInputDeviceIndex(device_index) && s_pXInputMapping )
|
||||
{
|
||||
return s_pXInputMapping;
|
||||
|
@ -576,7 +576,7 @@ SDL_GameControllerInit(void)
|
|||
pchMapping = SDL_PrivateGetControllerMappingFromMappingString( pMappingString );
|
||||
if ( pchGUID && pchName )
|
||||
{
|
||||
#ifdef __WIN32__
|
||||
#ifdef SDL_JOYSTICK_DINPUT
|
||||
if ( !SDL_strcasecmp( pchGUID, "xinput" ) )
|
||||
{
|
||||
s_pXInputMapping = pControllerMapping;
|
||||
|
@ -628,7 +628,7 @@ SDL_GameControllerInit(void)
|
|||
|
||||
if ( pchGUID && pchName )
|
||||
{
|
||||
#ifdef __WIN32__
|
||||
#ifdef SDL_JOYSTICK_DINPUT
|
||||
if ( !SDL_strcasecmp( pchGUID, "xinput" ) )
|
||||
{
|
||||
s_pXInputMapping = pControllerMapping;
|
||||
|
|
|
@ -113,7 +113,7 @@ extern JoystickGUID SDL_SYS_PrivateJoystickGetDeviceGUID( int device_index );
|
|||
*/
|
||||
extern JoystickGUID SDL_SYS_PrivateJoystickGetGUID(SDL_Joystick * joystick);
|
||||
|
||||
#ifdef __WIN32__
|
||||
#ifdef SDL_JOYSTICK_DINPUT
|
||||
/* Function to get the current instance id of the joystick located at device_index */
|
||||
extern int SDL_SYS_IsXInputDeviceIndex( int device_index );
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue