Sam Lantinga
ce5763230b
The backlight event is "change", not "add" or "remove"
2022-06-10 12:42:45 -07:00
Ethan Lee
964e979d06
hidapi: Allow disabling libusb support at runtime
2022-05-30 13:45:24 -07:00
Sam Lantinga
bef9f2b2c4
Don't trigger device notifications when Steam Deck backlight changes
2022-05-26 20:45:48 -07:00
Sam Lantinga
22d6e09a8d
Don't try to call hid_ble_scan() if HIDAPI is disabled
...
Fixes https://github.com/libsdl-org/SDL/issues/5699
2022-05-25 11:05:39 -07:00
Eddy Jansson
a40405d724
hidapi: Wrap CopyHIDDeviceInfo in define checks.
...
The purpose of this is to silence a 'defined but not used'
warning.
2022-04-20 09:33:40 -07:00
Sam Lantinga
7b3449b89f
Minor cleanup
2022-04-04 20:46:56 -07:00
Ozkan Sezer
f14c7bb443
added missing hidapi stuff for os/2 with libusb
2022-01-09 20:33:32 +03:00
Sam Lantinga
120c76c84b
Updated copyright for 2022
2022-01-03 09:40:21 -08:00
Sam Lantinga
67c4b99639
Fixed enabling udev hotplug detection on Linux
2021-12-15 10:39:42 -08:00
Ozkan Sezer
8f17af5e21
hidapi: mark libusb function pointers with LIBUSB_CALL.
2021-11-27 11:02:04 -08:00
Sylvain
d5813776db
Release UDEV ressources
2021-11-25 07:24:18 -05:00
Ozkan Sezer
b67965979a
SDL_hidapi.c: fix SDL_udev.h include path
...
fixes https://github.com/libsdl-org/SDL/issues/4981
2021-11-19 11:55:50 +03:00
Mathieu Eyraud
5fc7a90a8b
Fix refcounting in SDL_hid_exit
2021-11-12 01:25:15 -08:00
Sam Lantinga
9c3bcf8e8a
Added SDL_hid_ble_scan() for pairing Steam Controllers on iOS and tvOS
2021-11-11 17:31:14 -08:00
Sam Lantinga
b9b0df40bf
Fixed Linux build
2021-11-11 12:52:40 -08:00
Sam Lantinga
c9ada1c142
Made HIDAPI device change notifications available via SDL_hid_device_change_count()
2021-11-11 12:46:10 -08:00
Sam Lantinga
6c4b4ee7a6
Don't assert on API parameters
...
This causes lots of spam in test automation and it's not clear it's useful to developers. If we need this level of validation, we should add a log category for it.
2021-11-10 09:41:43 -08:00
Sam Lantinga
0f2bf62935
Fixed building hidapi when libusb is available
2021-11-09 06:20:46 -08:00
Sam Lantinga
b8327a4a48
Added SDL_HIDAPI_DISABLED so it can be disabled like other SDL subsystems
2021-11-08 07:19:45 -08:00
Sam Lantinga
f61b10dcf1
Do more robust validation of devices passed to the SDL HIDAPI functions
2021-11-08 06:34:32 -08:00
Ozkan Sezer
dd8c354843
SDL_hidapi.c: avoid possible NULL pointer dereferences.
2021-11-08 17:00:56 +03:00
Sam Lantinga
5b646cd19e
Build hidapi code into SDL as a new public API
...
This prevents conflicts with hidapi linked with applications, as well as allowing applications to make use of HIDAPI on Android and other platforms that might not normally have an implementation available.
2021-11-07 23:00:59 -08:00
Sam Lantinga
d4794028bb
Fixed build
2021-01-24 00:51:25 -05:00
Sam Lantinga
9e45372a2f
Fixed build on Android and iOS
2021-01-24 00:51:25 -05:00
Sam Lantinga
bf53651d73
Make sure we only do GameCube adapter initialization if we were able to load libusb
2021-01-24 00:51:24 -05:00
Sam Lantinga
3527b49459
Fixed initializing the Nyko and EVORETRO GameCube adaptors
...
This requires root on most Linux distributions, as we have to directly send USB messages to the devices to enable input reports.
2021-01-24 00:51:24 -05:00
Sam Lantinga
c8a64ad90c
Fixed building when SDL_LIBUSB_DYNAMIC is defined
2021-01-07 10:23:55 -08:00
Sam Lantinga
9130f7c377
Updated copyright for 2021
2021-01-02 10:25:38 -08:00
Sam Lantinga
ff913a22f4
Fixed compile warnings on platforms without hidapi support
2020-12-23 16:16:55 -08:00
Sam Lantinga
047b20e3b6
Fixed compile warnings on platforms without hidapi support
2020-12-23 16:11:16 -08:00
Sam Lantinga
706f63759c
Fixed build for platforms with only libusb hidapi implementations
2020-12-13 01:58:05 -08:00
Sam Lantinga
43aad96681
Fixed bug 5222 - Crash when running with -DHIDAPI=ON
...
Mathieu Eyraud
SDL dynamically loads libusb but does not check the return value of 'SDL_LoadFunction'.
Also libusb is loaded and initialized several time because 'SDL_hidapi_wasinit' is never set to true.
I made a patch if you want to test:
- check that 'hid_init' is called once and only once,
- check return value of 'hid_init',
- check return value of 'SDL_LoadFunction',
- check return value of 'SDL_malloc',
- add some debug logging.
2020-12-08 19:03:50 -08:00
Sam Lantinga
59f28b7f4b
Fixed whitespace
2020-12-03 18:17:01 -08:00
Sam Lantinga
9fc4a4c92c
Revamped Xbox One HIDAPI init sequence
...
Added support for querying the controller serial number on newer firmware
2020-11-24 22:25:26 -08:00
Sam Lantinga
5b3616c325
Generalized the raw input controller driver and moved XInput/WGI detection into it for XInput devices
...
This fixes bad report parsing for various newer Xbox controllers, and this driver is now preferred over XInput, since it handles more than 4 controllers.
2020-11-23 18:24:05 -08:00
Sam Lantinga
69a8c8468c
Fixed using more than one Xbox Bluetooth controller
...
Don't prevent duplicate devices using hidraw, instead libusb takes precedence and all hidraw devices that aren't handled by libusb are available
2020-03-04 09:42:08 -08:00
Sam Lantinga
bebc486774
We already have a hidapi implementation for Windows, we don't need libusb
2020-03-01 17:53:30 -08:00
Sam Lantinga
43aa1fa9e7
Added support for detecting previously unknown Xbox 360 and Xbox One controllers using the HIDAPI driver with libusb and Android
2020-01-18 11:21:14 -08:00
Sam Lantinga
4e682461cc
Reattach the kernel driver after closing USB controllers
2020-01-17 10:43:14 -08:00
Sam Lantinga
a8780c6a28
Updated copyright date for 2020
2020-01-16 20:49:25 -08:00
Sam Lantinga
4e1cc124d2
Improved Xbox One controller initialization
2020-01-16 15:32:39 -08:00
Sam Lantinga
a9482a1d60
Added support for the Nintendo GameCube adapter, tested on Steam Link hardware
2019-12-30 09:44:32 -08:00
Sam Lantinga
868551b121
Fixed duplicate controller entries on Mac OS X when using libusb, due to the HID interface number not being available in the Mac OS X HID code.
2019-12-20 21:00:16 -08:00
Sam Lantinga
c5024a182d
Backed out debug code
2019-12-19 15:21:44 -08:00
Sam Lantinga
e22e77dadc
Added an untested driver for the Nintendo GameCube adapter, based on code contributed by Ethan Lee
2019-12-19 15:01:35 -08:00
Sam Lantinga
4237b1834e
Fixed compiler warning
2019-12-19 04:31:00 -08:00
Sam Lantinga
52b6ab2196
Added support for the SteelSeries Stratus Duo
2019-12-16 17:11:23 -08:00
Ethan Lee
f7d82e5616
hidapi: Add SDL_hidapi.c, allows support for multiple hidapi backends.
...
This is currently supported on Linux and macOS. iOS and Android are not
supported at all, Windows support could be added with some changes to the libusb
backend. The Visual Studio and Xcode projects do not use this feature.
Based on Valve Software's hid.cpp, written in collaboration with Andrew Eikum.
2019-07-31 12:20:55 -04:00