Commit graph

27 commits

Author SHA1 Message Date
Sam Lantinga
0485c938d7 Added SDL_JoystickGetXInputUserIndex() 2018-10-25 12:54:42 -07:00
Sam Lantinga
6e0f2d6619 Use the HIDAPI driver for Xbox controllers on Windows, and determine the XInput mapping at runtime for extended functionality like rumble and guide button. 2018-08-15 23:14:45 -07:00
Sam Lantinga
4d30496429 Fixed input from the Steam Virtual Gamepad on Mac OS X 2018-08-15 19:53:34 -07:00
Sam Lantinga
fa59af0af0 There's no controller that's supported by both XInput and HIDAPI 2018-08-09 16:04:34 -07:00
Sam Lantinga
29023f51e8 Worked around bug with Sony PS Now PS3 controller where DirectInput polling will continue to return success after the controller is unplugged.
The code is now reliant on SDL_PrivateJoystickAdded() and SDL_PrivateJoystickRemoved() being called correctly when devices are added or removed on Windows
2018-08-09 16:03:50 -07:00
Sam Lantinga
db39b4811f Added HIDAPI joystick drivers for more consistent support for Xbox, PS4 and Nintendo Switch Pro controller support across platforms.
Added SDL_GameControllerRumble() and SDL_JoystickRumble() for simple force feedback outside of the SDL haptics API
2018-08-09 16:00:17 -07:00
Sam Lantinga
b81da78518 Added SDL_GameControllerMappingForDeviceIndex() to get the mapping for a controller before it's opened 2018-03-07 13:30:40 -08:00
Ethan Lee
b55bb6ff48 Use new XInput mapping for Win10+ (Bugzilla #3960) 2018-02-21 12:42:30 -05:00
Sam Lantinga
346af016a5 Updated copyright for 2018 2018-01-03 10:03:25 -08:00
Sam Lantinga
b044a3bba8 Added SDL hints to filter the set of game controllers reported by SDL 2017-08-09 11:59:29 -07:00
Philipp Wiesemann
6fb11d8e35 Windows: Fixed warning about unused variable.
Found by buildbot.
2017-02-03 23:30:43 +01:00
Sam Lantinga
58ac3b20ee Remember XInput controllers that we've already seen, so when the raw device list changes we don't assign the old device to the new XInput userid.
This isn't perfect, but at least we won't report the same device twice.
2017-02-02 17:33:40 -08:00
Sam Lantinga
1b24bfad38 Updated copyright for 2017 2017-01-01 18:33:28 -08:00
David Ludwig
bfc9b8c565 WinRT: build fixes
These fixes are lumped into two categories:

1. add new file, SDL_dataqueue.c, to UWP/WinRT build-inputs (via MSVC project
   files)

2. implement a temporary, hack-fix for a build error in SDL_xinputjoystick.c.
   Win32's Raw Input APIs are, unfortunately, not available for use in UWP/WinRT
   APIs.  There does appear to be a replacement API, available in the
   Windows.Devices.HumanInterfaceDevice namespace.

   This fix should be sufficient to get SDL compiling again, without affecting
   Win32 builds, however using the UWP/WinRT API (in UWP/WinRT builds) would
   almost certainly be better (for UWP/WinRT builds).

   TODO: research Windows.Devices.HumanInterfaceDevice, and use that if and as
   appropriate.
2016-12-10 15:23:17 -05:00
Sam Lantinga
aea1a556ac Guess the USB VID/PID of XInput devices 2016-11-24 12:24:22 -08:00
Sam Lantinga
1b032a0419 Implemented SDL_GetHintBoolean() to make it easier to check boolean hints 2016-10-07 23:40:44 -07:00
Sam Lantinga
4d1a9e8231 Allow using the game controller API with arcade sticks and other XInput devices 2016-02-16 13:47:37 -08:00
Sam Lantinga
7ee8dda270 Updated copyright to 2016 2016-01-02 10:10:34 -08:00
David Ludwig
b96b7bef26 WinRT: fixed build error in latest XInput code
This change has also been tested as buildable + runnable on Win32 + MSVC 2015,
2013, 2012, and 2010.  It may fix similar build errors (in XInput code) that
are appearing in MingW builds (on buildbot).
2015-11-14 21:29:14 -05:00
Sam Lantinga
bf785c766b SDL - added new SDL_JoystickCurrentPowerLevel() API that returns the battery level of the selected joystick. Currently only implemented for XInput devices, other platforms are a TODO.
CR: Sam
2015-09-30 15:39:30 -07:00
Ryan C. Gordon
5c7974ec41 Another attempt to get this to compile. 2015-05-28 01:08:33 -04:00
Ryan C. Gordon
891c2792ad Patched to compile on MingW.
(I think!)
2015-05-28 01:02:03 -04:00
Ryan C. Gordon
f6992428b4 Move tests from SDL_config higher up in Windows joystick/haptic code.
Fixes Bugzilla #2932.
2015-05-28 00:54:52 -04:00
Sam Lantinga
56b58afdbe Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
Sam Lantinga
d32eb0d9e5 Removed useless assert 2014-07-07 13:19:53 -07:00
Sam Lantinga
9d42bf534d Fixed mingw64 build and warnings 2014-07-07 10:26:28 -07:00
Sam Lantinga
9cdeec59f3 Split the XInput and DirectInput code so Windows RT can use the existing XInput support.
--HG--
rename : src/audio/directsound/directx.h => src/core/windows/SDL_directx.h
rename : src/haptic/windows/SDL_syshaptic.c => src/haptic/windows/SDL_windowshaptic.c
rename : src/haptic/windows/SDL_syshaptic_c.h => src/haptic/windows/SDL_windowshaptic_c.h
rename : src/joystick/windows/SDL_dxjoystick.c => src/joystick/windows/SDL_dinputjoystick.c
rename : src/joystick/windows/SDL_dxjoystick_c.h => src/joystick/windows/SDL_dinputjoystick_c.h
rename : src/joystick/windows/SDL_dxjoystick_c.h => src/joystick/windows/SDL_windowsjoystick_c.h
2014-07-03 15:39:55 -07:00