[patch] Low magnitudes with XInput haptics

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[patch] Low magnitudes with XInput haptics

Trent Gamblin
I recently tried the haptics support on a couple joysticks. One worked seemingly fine (an Xbox 360 pad) while the
other (Logitech F710) I can barely detect a rumble using the basic rumble support (SDL_RumbleInit etc.) I dug through
the code a little and found that although SDL_HapticEffect has a max magnitude of 32767, XInput expects max to be
65535[1]. I attached a patch. I'm not certain it's completely correct as I didn't quite understand what "180 degree
phase shift" for negative magnitudes means, but with positive values this makes my gamepad move.

[1]https://msdn.microsoft.com/en-us/library/windows/desktop/microsoft.directx_sdk.reference.xinput_vibration(v=vs.85).aspx

Best regards,

Trent Gamblin

_______________________________________________
SDL mailing list
[hidden email]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

xihaptic.diff (1K) Download Attachment
Loading...