Sam Lantinga
a8120104ad
The Nintendo Online classic controllers and Joy-Cons shouldn't show up as Switch Pro controllers
2022-08-03 13:53:49 -07:00
Sam Lantinga
6e1ee1d4a5
sort the controller names
2022-08-03 13:51:25 -07:00
Sam Lantinga
8ab9dc8b2b
Fixed crash if Joy-Cons are disabled while a combined Joy-Cons controller is open
2022-08-03 13:18:00 -07:00
Sam Lantinga
bcdef4aaf9
Added separate hints for Nintendo Online classic controllers and Joy-Cons
...
This allows them to be enabled/disabled separately from Switch Pro HIDAPI support
2022-08-03 13:07:47 -07:00
Mathieu Eyraud
59a104b803
Do not pass NULL to memcpy
...
ReadJoyConControllerType calls WriteSubcommandSync with pbuf=NULL
2022-08-02 06:38:51 -07:00
Mathieu Eyraud
42b2320756
Fix memory leak of children for combined JoyCon
2022-08-02 06:33:18 -07:00
Sam Lantinga
12aa4d5653
Added header needed for SDL_Delay()
2022-08-01 11:11:25 -07:00
Sam Lantinga
aeb275149a
Poll DirectInput devices to get their initial state
...
Fixes https://github.com/libsdl-org/SDL/issues/3816
2022-08-01 10:39:56 -07:00
Sam Lantinga
13e0c40ec2
Added mapping for the 8BitDo Pro 2 controller in DirectInput mode over Bluetooth on Linux
2022-07-29 17:28:36 -07:00
Sam Lantinga
62c831661c
Added mapping for the 8BitDo Pro 2 controller in DirectInput mode
2022-07-29 17:14:55 -07:00
Sam Lantinga
41c363f7d6
Note that the PDP Versus Fighting Pad is an arcade fighting pad
2022-07-29 16:29:25 -07:00
Sam Lantinga
f3c1194c0f
Removed obsolete comment
2022-07-28 21:50:41 -07:00
Sam Lantinga
aee179e46f
Removed debug output
2022-07-28 21:50:20 -07:00
Sam Lantinga
d8fd78736b
Added entry for the Nintendo Switch Joy-Con controller pair
2022-07-28 21:44:23 -07:00
Sam Lantinga
875b737c64
Added support for the Nintendo Online NES Controllers to the HIDAPI driver
2022-07-28 21:40:01 -07:00
Sam Lantinga
ab967475c6
Greatly improved Nintendo Joy-Con support using the HIDAPI driver
...
* Added support for mini-gamepad mode for Joy-Con controllers, matching the mapping for hid-nintendo on Linux and iOS 16
* Added the ability to merge left and right Joy-Con controllers into a single Pro-style controller
* Added the hint SDL_HINT_JOYSTICK_HIDAPI_SWITCH_COMBINE_JOY_CONS to control this merging functionality
* Removed the hint SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS
2022-07-28 19:38:38 -07:00
Sam Lantinga
dfed862a66
Fixed variable shadow warning
2022-07-28 19:35:46 -07:00
Sam Lantinga
2fa2f9ff77
Greatly improved Nintendo Joy-Con support using the HIDAPI driver
...
* Added support for mini-gamepad mode for Joy-Con controllers, matching the mapping for hid-nintendo on Linux and iOS 16
* Added the ability to merge left and right Joy-Con controllers into a single Pro-style controller
* Added the hint SDL_HINT_JOYSTICK_HIDAPI_SWITCH_COMBINE_JOY_CONS to control this merging functionality
* Removed the hint SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS
2022-07-28 19:22:27 -07:00
Sam Lantinga
def60ce6fe
Fixed the name of the HIDAPI Joy-Con controller for consistency with other drivers
2022-07-27 19:20:42 -07:00
Sam Lantinga
0f1be9401f
Updated mapping for Joy-Con controllers using hid-nintendo
...
This matches the mapping on iOS 16 and will match the HIDAPI
implementation.
2022-07-27 17:32:51 -07:00
Sam Lantinga
756978a236
Left and right single Joy-Con controllers are mapped as individual mini controllers
2022-07-27 16:17:32 -07:00
Sam Lantinga
4990bd0517
Added debug code to show available inputs on iOS/tvOS controllers
2022-07-27 16:17:32 -07:00
Sam Lantinga
a169259f62
Actually we don't need to unlock to send k_eSwitchProprietaryCommandIDs_ForceUSB since we don't wait for reply
2022-07-27 09:05:02 -07:00
Sam Lantinga
c51464d9d8
Put the Nintendo Switch Pro controller back into enhanced mode as needed
...
Fixes https://github.com/libsdl-org/SDL/issues/3450
2022-07-27 09:00:39 -07:00
Sam Lantinga
a423848ea0
Allow floating point values for SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED
...
This allows setting the brightness of the home LED on Nintendo Switch Pro controllers, in the range 0.0 - 1.0.
This can be updated at runtime by setting the hint dynamically.
Fixes https://github.com/libsdl-org/SDL/issues/3787
2022-07-25 11:26:18 -07:00
diddily
0ec5bb4e6d
Add missing controller events to `SDL_GameControllerEventState()`
...
Events to handle controller touchpads and sensors were added to the library but not added in `SDL_GameControllerEventState()`. This change adds the missing events.
2022-07-25 08:55:17 -07:00
Cameron Gutman
3ab1e303ec
joystick: Refactor and fix a few bugs in Shield HIDAPI driver
...
- CMD_CHARGE_STATE was checking the seqnum instead of the payload
- Off-by-one error in size validation for command payload
- Unused payload space was left uninitialized in output report
2022-07-24 15:36:30 -05:00
Sam Lantinga
f9beef760a
Added support for the Nintendo Switch Joy-Con Controllers on iOS and tvOS 16
2022-07-22 18:58:29 -07:00
Sam Lantinga
aad7ef6eaf
Added support for the Nintendo Switch Pro Controller on iOS and tvOS 16
2022-07-22 10:58:34 -07:00
Sam Lantinga
be3a945a8b
Added support for the 8BitDo Ultimate Wired Controller for Xbox
2022-07-20 11:05:55 -07:00
Sam Lantinga
cef1514b01
Fixed some Xcode warnings
2022-07-17 09:07:04 -07:00
Sam Lantinga
883409ea07
Added support for the misc1 button on the Nintendo Switch Pro Controller
...
when using hid_nintendo kernel driver
2022-07-13 11:26:42 -07:00
SuperSamus
9a4f200d44
gamecontrollerdb: Linux, add mappings for hid-nintendo driver and more
...
Taken from https://github.com/gabomdq/SDL_GameControllerDB/blob/master/gamecontrollerdb.txt
2022-07-13 11:23:15 -07:00
Sam Lantinga
06c7d22653
Added mappings for the HORI Fighting Stick mini 4 on Linux and macOS
2022-07-12 18:53:53 -07:00
Sam Lantinga
e24b971a34
Added support for the NVIDIA Shield controller guide button
2022-07-12 17:53:03 -07:00
Cameron Gutman
b321eae51a
joystick: Fix spurious battery empty events when opening a Shield controller
2022-07-11 19:43:25 -05:00
Cameron Gutman
a0d8848baa
joystick: Plumb SDL_JoystickSendEffect() for the Shield HIDAPI driver
...
The effect data format consists of one command byte followed by zero or more
payload bytes.
2022-07-11 19:38:26 -05:00
Ozkan Sezer
4fa2653394
SDL_GetJoystickGUIDInfo: byte-swap vendor, product and version values.
...
Reference issue: https://github.com/libsdl-org/SDL/issues/5907
2022-07-12 00:55:00 +03:00
Cameron Gutman
6e712d2440
joystick: Add HIDAPI driver for NVIDIA SHIELD 2017 controller
...
Basic input already works using the OS HID driver, but this enables
force feedback and battery state reporting.
2022-07-10 10:53:26 -07:00
Cameron Gutman
3242265ff1
joystick: Fix endianness issues in Xbox HIDAPI drivers
2022-07-10 10:49:38 -07:00
chalonverse
f317d619cc
Xbox GDKX support ( #5869 )
...
* Xbox GDK support (14 squashed commits)
* Added basic keyboard testing
* Update readme
* Code review fixes
* Fixed issue where controller add/removal wasn't working (since the device notification events don't work on Xbox, have to use the joystick thread to poll XInput)
2022-07-01 13:59:14 -07:00
Cameron Gutman
3e114872e8
joystick: Fix redetection of HIDAPI joysticks after reinitializing
...
The HIDAPI joystick driver doesn't properly reset the change counter
it uses to track if re-enumeration is needed when the joystick
subsystem is quit and then reinitialized.
The first SDL_Init(SDL_INIT_JOYSTICK) will result in the expected
HIDAPI joysticks appearing, but subsequent calls will result in no
joysticks being enumerated until another HIDAPI joystick is added
or removed from the system.
2022-06-30 20:43:14 -07:00
Jade Macho
6a2e6c82a0
Add SDL_HINT_DIRECTINPUT_ENABLED (on by default)
2022-06-28 15:59:05 -07:00
Sourcery AI
cddf095a16
'Refactored by Sourcery'
2022-06-27 17:55:47 -07:00
Pierre Wendling
6c536afdb7
Fix C89 declaration for macOS modules.
...
Since Clang 14, `-Wdeclaration-after-statement` is enforced on every
standard.
2022-06-27 15:19:40 -07:00
chalonverse
3b191580c3
Windows GDK Support ( #5830 )
...
* Added GDK
* Simplfied checks in SDL_config_wingdk.h
* Added testgdk sample
* Added GDK readme
* Fixed error in merge of SDL_windows.h
* Additional GDK fixes
* OpenWatcom should not export _SDL_GDKGetTaskQueue
* Formatting fixes
* Moved initialization code into SDL_GDKRunApp
2022-06-27 10:19:39 -07:00
Francisco Javier Trujillo Mata
7fd46ec581
Initial PS2_Joystick implementation
2022-06-27 00:32:43 -07:00
Francisco Javier Trujillo Mata
2b41f497db
Improve Joystick removing semaphores
2022-06-22 15:08:41 +02:00
Francisco Javier Trujillo Mata
c3a5e4aa7b
Adding GetGamepadMapping to Vita Joystick driver
2022-06-22 02:23:00 +03:00
Sam Lantinga
eb7e29a8b2
Fixed crash when the joystick product name isn't available
2022-06-17 17:43:14 -07:00
Sam Lantinga
b0e827fb65
Enable improved rumble emulation on DualSense(tm) Wireless Controllers with firmware version 2.24 and newer
2022-06-17 07:55:53 -07:00
Sam Lantinga
16f55fbdb4
Separate the controller protocol from the controller style
...
This allows us to handle controllers that use the Xbox protocol but look like Nintendo Switch or Playstation controllers, like the Qanba Dragon Arcade Stick in PC mode
2022-06-15 20:46:01 -07:00
Sam Lantinga
017e237005
Removed the Qanba Obsidian Arcade Joystick from the unknown controller list
2022-06-15 17:32:46 -07:00
Sam Lantinga
a9cf313eef
Added the Qanba Obsidian and Dragon Arcade Sticks to the arcade stick list
2022-06-15 17:28:29 -07:00
Sam Lantinga
bfe81a0c05
Added the name of the Qanba Obsidian Arcade Joystick in PC mode
2022-06-15 17:28:20 -07:00
Sam Lantinga
a6a2cdbd7c
Added the name of the Qanba Dragon Arcade Joystick in PC mode
2022-06-15 17:28:18 -07:00
Sam Lantinga
a5d338bd2d
Added support for the Qanba Dragon Arcade Joystick (PS3) on macOS
2022-06-15 14:11:00 -07:00
Sam Lantinga
7d7c48302b
Use python3 for sort_controllers.py
2022-06-15 14:10:22 -07:00
Sam Lantinga
72fea0ed6f
Added support for the Qanba Dragon Arcade Joystick
2022-06-15 13:58:28 -07:00
Ozkan Sezer
714502d373
minor windows warning fixes.
2022-06-13 22:15:56 +03:00
Sam Lantinga
68544be44b
Added support for the Nintendo Online controllers
2022-06-10 11:31:59 -07:00
Sam Lantinga
9202df0472
Implemented SDL_GameControllerGetFirmwareVersion() for HIDAPI PS5 controllers
2022-06-09 18:11:34 -07:00
Sam Lantinga
c7f4103807
Special case for k_eControllerType_XInputSwitchController in the raw input path
2022-06-09 13:47:29 -07:00
Sam Lantinga
e6cb082232
Fixed the default mapping on Windows for the HORI Fighting Commander
2022-06-09 13:20:38 -07:00
Sam Lantinga
d58d637ac6
Added support for the Qanba Obsidian Arcade Joystick on Linux
2022-06-08 11:07:36 -07:00
Christoph Reichenbach
3a20274ddf
Refactoring: move GUID operations out of Joystick
...
- SDL_JoystickGUID -> SDL_GUID (though we retain a type alias)
- Operations for GUID <-> String ops are now in
src/SDL_guid.c and include/SDL_guid.h
- The corresponding Joystick operations delegate to SDL_guid.c
- Added test/testguid.c
2022-06-04 17:22:13 -07:00
Sam Lantinga
423141bfca
Added a function to get the controller firmware version
2022-06-03 18:50:00 -07:00
Sam Lantinga
17410887d0
Separated controller type data into a C file
2022-06-03 15:03:08 -07:00
Sam Lantinga
7fa46ec40b
The Google Pixel fingerprint sensor also shows up on Linux when running on the phone
2022-05-31 11:11:19 -07:00
Sam Lantinga
d2c4d74dd0
Fixed build with MinGW-64 windows.devices.power.h
...
The MinGW-64 header defines the parameters as ABI::Windows::Foundation::IReference<INT32 > **, but the Windows header defines the parameters as __FIReference_1_int**
2022-05-27 15:49:35 -07:00
Sam Lantinga
bd22ca762e
Revert "Workaround for compiling with MinGW-w64"
...
This reverts commit efdf43aa9b
.
The broken mingw headers aren't in an official release yet, so reporting this upstream.
2022-05-27 15:40:50 -07:00
Sam Lantinga
efdf43aa9b
Workaround for compiling with MinGW-w64
...
Fixes bug https://github.com/libsdl-org/SDL/issues/5589
2022-05-27 15:34:45 -07:00
Sam Lantinga
b28d304b23
Only include controller_type.h in SDL_joystick.c
...
It has a huge array of controllers and we only want it instantiated once
2022-05-24 17:24:54 -07:00
Sam Lantinga
b1cf322971
Fixed HIDAPI PS4 controller being picked up when running under Steam
...
Input with PS4 configuration enabled
2022-05-19 16:50:59 -07:00
Sam Lantinga
47f1cb550d
Fixed picking up the correct mapping for virtual controllers on Android
...
Fixes https://github.com/libsdl-org/SDL/issues/5662
2022-05-18 23:48:15 -07:00
Sam Lantinga
f7b774a7e0
Fixed build error on Linux if HAVE_INOTIFY isn't defined
...
Fixes https://github.com/libsdl-org/SDL/issues/5682
2022-05-18 17:59:17 -07:00
Cameron Cawley
0cca71a846
Use SDLCALL for callbacks in public APIs
2022-05-18 15:01:27 -07:00
Sam Lantinga
1f2a241688
Add new virtual joysticks to the end of the list
...
This guarantees that the device index that's returned is stable, as long as no joystick hotplug events occur.
2022-05-16 09:02:35 -07:00
Sam Lantinga
3c3ccb1d48
Fixed crash if a virtual joystick was disconnected
2022-05-16 08:56:17 -07:00
Sam Lantinga
48b6cd8bc2
Fixed whitespace
2022-05-16 07:23:30 -07:00
Sam Lantinga
f0bc5c9cbf
Added effects support for virtual controllers
2022-05-16 07:21:28 -07:00
Sam Lantinga
b3a18706ee
Removed unused variables
2022-05-16 06:37:38 -07:00
Sam Lantinga
7e005bd843
Fixed mapping the paddle buttons with the virtual controller
2022-05-16 06:22:18 -07:00
Sam Lantinga
bfac54b59c
Added the ability to specify which buttons and axes are present for virtual controllers
2022-05-15 20:34:44 -07:00
Sam Lantinga
94eeb587c1
First pass at extending virtual controller functionality
...
Added the ability to specify a name and the product VID/PID for a virtual controller
Also added a test case to testgamecontroller, if you pass --virtual as a parameter
2022-05-15 20:01:12 -07:00
Sam Lantinga
7ad15c5b8f
Added game controller support for virtual joysticks
...
Fixes https://github.com/libsdl-org/SDL/issues/5662
2022-05-15 09:35:52 -07:00
Sam Lantinga
a3c1ca1fa1
Added support for the Backbone One guide button
...
The guide button is activated on a long press (> 400ms)
2022-05-06 09:07:36 -07:00
Ozkan Sezer
3f813cf1ef
SDL_rawinputjoystick.c: fixed -Werror=declaration-after-statement
2022-05-04 10:05:56 +03:00
atfrase
db9e14e504
disabled linux joystick debugging outputs and reverted unnecessary comment edit
2022-05-03 10:44:09 -07:00
atfrase
3b53555bcf
copied default Steam Controller mapping for wired and wireless-dongle USB pids
2022-05-03 10:44:09 -07:00
atfrase
13b1bf4f21
added default gamepad mapping for Steam Controller with new GUID (possibly caused by the firmware update to enable BLE?)
2022-05-03 10:44:09 -07:00
atfrase
f7a19f9ea8
relaxed the digital hat deadzone slightly, and fixed typo in DEBUG_GAMEPAD_MAPPING define
2022-05-03 10:44:09 -07:00
atfrase
3696e23d09
added hints SDL_HINT_LINUX_DIGITAL_HATS and SDL_HINT_LINUX_HAT_DEADZONES to control the new Linux hat handling; added define DEBUG_GAMEPAD_MAPPINGS to log messages when generating default gamepad mapings for Linux joysticks
2022-05-03 10:44:09 -07:00
atfrase
0b8e796e2c
added hueristic to differentiate digital vs analog 'hat' input axes and expose the latter as regular axes; added automatic deadzones to hat outputs, in case analog axes are still mapped to digital hats; updated automatic gamepad control mapping to more completely follow the spec
2022-05-03 10:44:09 -07:00
Daniel Brookman
d1a3981bf8
Fix crash when reading background events for MFi controllers on macOS
...
Enabling GCController.shouldMonitorBackgroundEvents to read background events
for MFi controllers before receiving the first GCControllerDidConnectNotification
is apparently a no-go on macOS (12.3.1 for me), and would crash on attempt.
Apple's documentation is... not great, and doesn't point this out.
This waits for IOS_AddMFIJoystickDevice() to get called down the chain from GCControllerDidConnectNotification, and enables GCController.shouldMonitorBackgroundEvents
if it hadn't been already.
On iOS and tvOS, GCController.shouldMonitorBackgroundEvents is ignored, so
there's no need to check their versions.
2022-05-02 15:31:28 -07:00
Jan200101
bb0b6dd42e
Fixed using WGI without XInput
2022-05-02 11:33:55 -07:00
Carl Friess
2ccb0dfd16
Check for macOS 10.16 to support apps built with older macOS SDKs
2022-04-29 00:24:23 -07:00
Sam Lantinga
e551384a99
Added functions to get the platform dependent name for a joystick or game controller
2022-04-26 14:54:14 -07:00
Jibb Smart
d7c07d6b09
Read motion sensor scale from Switch controllers ( #5555 )
...
* Read IMU scale data from Switch controllers. Up until now, SDL has used hard-coded scaling which isn't correct with some supported controllers.
* Moved declarations to beginning of code blocks to better fit with SDL style requirements
2022-04-26 09:57:17 -07:00
Dimitriy Ryazantcev
c39df2fb0c
joystick: get HID top-level collection preparsed data directly from RawInput API.
2022-04-26 09:48:35 -07:00