We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4478 - Haptic on Switch Pro Controller not detected
Summary: Haptic on Switch Pro Controller not detected
Status: NEW
Alias: None
Product: SDL
Classification: Unclassified
Component: haptic (show other bugs)
Version: 2.0.9
Hardware: x86_64 Mac OS X (All)
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-30 12:47 UTC by williamxie3421
Modified: 2020-06-16 00:27 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description williamxie3421 2019-01-30 12:47:55 UTC
I've tried to implement a rumble system for my switch pro controller. Problem is that SDL_JoystickIsHaptic() returned me 1, while SDL_NumHaptics() returned 0. When I tried to open a Haptic Device using SDL_HapticOpenFromJoystick(), it returned me NULL. However, the joystick did rumble when I called SDL_JoystickRumble() function with both left and right motors correctly responded.

I'm using the SDL2# binding by flibitijibibo but it shouldn't change anything since it's calling the same functions. And my OS X version is 10.14 Mojave.

I came here because the mighty internets does not seem to know about this problem.
Comment 1 RustyM 2020-06-16 00:27:11 UTC
Try using SDL_GameControllerRumble() or SDL_JoystickRumble() instead. This uses a newer haptic system inside SDL that works with the Switch Pro controller, PS4 controller, and more. I'm not sure, but you may not even need to init with SDL_INIT_HAPTIC to use this newer API. It's much simpler than the older Haptic APIs too.