src/joystick/winrt/SDL_xinputjoystick.c
changeset 8957 6bed922bc4dd
parent 8860 c4133d635375
child 8958 ef544b7b4c4f
--- a/src/joystick/winrt/SDL_xinputjoystick.c	Wed Jun 25 17:24:06 2014 -0400
+++ b/src/joystick/winrt/SDL_xinputjoystick.c	Wed Jun 25 22:03:05 2014 -0400
@@ -524,6 +524,17 @@
     return SDL_TRUE;
 }
 
+SDL_bool SDL_SYS_IsXInputGamepad_DeviceIndex(int device_index)
+{
+    XINPUT_CAPABILITIES deviceCaps;
+
+    if (SDL_XInput_GetDeviceCapabilities(device_index, &deviceCaps) != 0) {
+        return SDL_FALSE;
+    }
+
+    return (deviceCaps.SubType == XINPUT_DEVSUBTYPE_GAMEPAD);
+}
+
 #endif /* SDL_JOYSTICK_XINPUT */
 
 /* vi: set ts=4 sw=4 expandtab: */