Sam Lantinga
785d784a93
Set the output value for ParseExtensionResponse() in all return cases
2022-09-01 22:30:05 -07:00
Sam Lantinga
046aaa2d21
Use auto calibration for the Wii Nunchuk thumbstick axis values
2022-09-01 21:37:26 -07:00
Sam Lantinga
8381e008ea
Handle hotplugging of Wii controller extensions
2022-09-01 21:13:16 -07:00
Sam Lantinga
396411c090
Added mapping for the Wii Nunchuk extension
2022-09-01 20:27:34 -07:00
Sam Lantinga
e19b36d871
Initial support for the Wii Remote with Nunchuk extension
2022-09-01 19:29:20 -07:00
Sam Lantinga
c887cb02af
Added the hint SDL_HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED to control whether the player LED should be lit on the Nintendo Wii controllers
...
Also fixed the Y axes on the Wii U Pro controller, and various formatting cleanup
2022-09-01 16:30:55 -07:00
Ozkan Sezer
0ffaf5b871
SDL_hidapi_wii.c: fix build in c89 mode and builds using watcom compiler
2022-09-02 02:04:20 +03:00
Sam Lantinga
c72e14e8f4
Added initial support for Wii controllers (thanks @tellowkrinkle!)
2022-09-01 15:29:41 -07:00
Sam Lantinga
7708bf0f8a
Try matching game controller mappings on CRC and version and fall back to no CRC and no version, in that order.
...
We do exact match when adding mappings, but loose matching everywhere else we look up a mapping for a GUID.
2022-09-01 08:18:58 -07:00
Sam Lantinga
7861f924ea
Removed debug print statements
2022-08-31 13:34:43 -07:00
Sam Lantinga
62f2379e4c
Try up to 20 times to read the controller type
...
It takes a while for Joy-Cons to initialize when plugged in via the Nintendo Joy-Con Charging Grip.
2022-08-31 13:24:23 -07:00
Sam Lantinga
e5f161bda4
Restored accidentally removed code to guess XInput device
2022-08-30 19:12:22 -07:00
Ozkan Sezer
973a677a2d
SDL_xinputjoystick.c: commented out GuessXInputDevice()
...
Not used since commit 277b033e78235d6ffad7525a1fb9acfef3a43433.
2022-08-31 02:32:28 +03:00
Shawn Hoffman
42d09a8f42
wgi: refcount the delegate objects
2022-08-30 15:01:31 -07:00
Shawn Hoffman
ca915b1884
WGI_JoystickUpdate: bounds-check array sizes
2022-08-30 14:59:38 -07:00
Sam Lantinga
cdaafcec0d
The Kinvoca Joy-Cons are handled by the Joy-Con driver, not the Switch Pro driver.
2022-08-30 14:56:11 -07:00
Sam Lantinga
b2c3237b75
Added support for the Kinvoca Joy-Cons
...
These report their VID/PID as a Nintendo Switch Pro controller, but they are actually left/right Joy-Cons. We'll fix up the joystick GUID so applications can handle them appropriately.
2022-08-30 14:14:38 -07:00
Sam Lantinga
92d3fc4883
Fixed deadlock when shutting down the Windows joystick system
2022-08-30 12:59:02 -07:00
Sam Lantinga
0e4baf1c4e
Don't crash if SDL functions are passed a closed joystick or gamecontroller
2022-08-30 12:39:23 -07:00
Sam Lantinga
675d90c708
Revert "wgi: refcount the delegate objects"
...
This reverts commit ff233fe3060e51706937a7b366438403bce774a4.
This doesn't compile cleanly with Visual Studio and I don't want to introduce any subtle issues because we're passing the wrong types of pointers to WGI functions.
2022-08-30 12:09:57 -07:00
Sam Lantinga
40bd4feedc
Revamped joystick locking
...
This makes the joystick locking more robust by holding the lock while updating joysticks.
The lock should be held when calling any SDL joystick function on a different thread than the one calling SDL_PumpEvents() and SDL_JoystickUpdate().
It is now possible to hold the lock while reinitializing the joystick subsystem, however any open joysticks will become invalid and potentially cause crashes if used afterwards.
Fixes https://github.com/libsdl-org/SDL/issues/6063
2022-08-30 11:42:13 -07:00
Shawn Hoffman
ff233fe306
wgi: refcount the delegate objects
...
assert if calls become unbalanced.
2022-08-30 10:48:10 -07:00
Sam Lantinga
2f08bf2313
Added the share button to the Linux mapping for the third party Nintendo Switch Pro controllers
2022-08-29 22:15:35 -07:00
Sam Lantinga
b2ac758f61
Added support for the Hori Fighting Stick Alpha to the HIDAPI driver
2022-08-29 17:33:00 -07:00
Ludovico de Nittis
e8cb4da71f
Add utility function to detect if SDL is inside a sandbox
...
Refactor the previous sandbox check in a standalone function that also
includes Snap support.
Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
2022-08-29 06:30:40 -07:00
Sam Lantinga
1153aaae0d
Fixed compiling with USB_GET_DEVICEINFO on DragonFly BSD
...
Although the ioctl() currently fails on this platform...
2022-08-29 00:15:56 -07:00
Sam Lantinga
57cbec1095
Added controller mappings for Xbox 360, PS4, and PS5 controllers on OpenBSD
...
Removed the axis flipping hack for Xbox controllers which would actually apply to any controller with a full 16-bit range.
Fixes https://github.com/libsdl-org/SDL/issues/6143
2022-08-28 23:18:40 -07:00
Sam Lantinga
0b8b321f9e
Allow the product version to be different when trying to find a controller mapping
...
This is in the hope that revving the product version doesn't change the mapping, which is the case for some devices. In cases where it does, we just need to provide a mapping for each version of the product.
2022-08-28 23:01:30 -07:00
Sam Lantinga
761b9d1e49
Use the HID usage for the button as the button number
2022-08-28 22:33:17 -07:00
Sam Lantinga
a9d3935a84
Improved code to get the name and guid for joysticks on OpenBSD and NetBSD
...
Also dynamically allocate joysticks to reduce static memory usage
2022-08-28 18:20:54 -07:00
Sam Lantinga
32700294e2
Don't crash if SDL_CreateJoystickGUID() is passed a NULL name
2022-08-28 18:20:54 -07:00
Sam Lantinga
bac8df4abd
Fixed memory leak when out of memory
2022-08-28 18:20:54 -07:00
Sam Lantinga
ffbad3617c
Use the correct type for the device_instance
2022-08-28 18:20:54 -07:00
Sam Lantinga
4a800ae149
Created a consolidated define enabling BSD gameport joystick support
2022-08-28 18:20:54 -07:00
Sam Lantinga
42f90c6292
Removed unused path variable
2022-08-28 18:20:54 -07:00
Cameron Gutman
b7c1fbf9f0
WGI: Fix a couple of reference leaks
2022-08-28 17:38:02 -05:00
Sam Lantinga
0db1813049
Applied OpenBSD patch
...
http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/ports/devel/sdl2/patches/patch-src_joystick_bsd_SDL_bsdjoystick_c?rev=1.5&content-type=text/plain&hideattic=1
2022-08-28 07:27:01 -07:00
Sam Lantinga
3cbfd75d0f
Re-added the CRC to the joystick guid
...
This is now used as a crc field in the mapping rather than directly in mapping guids, for better mapping compatibility between versions of SDL.
Added SDL_GetJoystickGUIDInfo() to get device information encoded in a joystick GUID, so that mapping programs can clear the CRC from the GUID when generating mappings.
sort_controllers.py has been updated to extract the CRC from mappings created by older mapping programs and convert it into the new crc field. It will also take the CRC into account when checking for duplicate mappings.
Also regenerated the GUIDs for the PS2/PSP/Vita controller mappings, fixing https://github.com/libsdl-org/SDL/issues/6151
2022-08-27 19:00:31 -07:00
Sam Lantinga
b188a916ff
Fixed uhid device name for non-OpenBSD platforms
2022-08-27 09:46:28 -07:00
Brad Smith
3f93ec470a
Add support for OpenBSD's ujoy(4)
2022-08-27 09:45:08 -07:00
Sam Lantinga
9a01eac57d
Temporarily disable joystick GUID CRCs
2022-08-26 13:45:05 -07:00
Sam Lantinga
f6c2c22d38
Don't try to use the charging port for the PowerA wireless controller as an input device
2022-08-25 22:25:25 -07:00
Sam Lantinga
f1aa843415
Don't report rumble capability for Nintendo Online controllers
2022-08-25 21:51:43 -07:00
Sam Lantinga
babaa7d2bd
Fixed PS3 accelerometer values on little endian systems
2022-08-24 16:10:47 -07:00
Julio C. Rocha
05983fb8ee
Add Mayflash PC043 adapter
2022-08-24 15:34:46 -07:00
Sam Lantinga
e7332cd814
Fixed zero CRC matching in the controller mapping database
2022-08-24 15:28:56 -07:00
Sam Lantinga
970344719a
Fixed the Nintendo Switch Pro mappings on iOS/tvOS
2022-08-24 09:39:01 -07:00
Sam Lantinga
1fc7f68118
Document that it's not possible to use the HIDAPI driver for PS3 controllers on Windows
2022-08-24 06:38:36 -07:00
Sam Lantinga
645b0f6abf
Enable HIDAPI PS3 support by default on macOS
2022-08-24 01:30:29 -07:00
Sam Lantinga
3d62ebdbf6
Fixed HIDAPI PS3 support on macOS
2022-08-24 00:34:30 -07:00