antimicrox
antimicrox copied to clipboard
Add support for DualSense trigger haptic feedback
Add support for DualSense trigger haptic feedback if SDL version is greater or equal to 2.0.16. There are two supported effects, click and rigid which can be configured the the axis edit dialog if a DualSense controller is connected. The feedback point follows the trigger point, i.e. the configured dead-zone.
In preparation of this change, remove some dead XML related code and clean-up the axis edit dialog.
In preparation of this change, remove some dead XML related code and clean-up the axis edit dialog.
Could you open separate PR with these cleanups and removal of dead code? It would make repo history cleaner :)
I extracted it into #504.
I see this PR is targeted specifically for PS5 gamepad.
if (parentSet->getInputDevice()->getControllerType() == SDL_GameControllerType::SDL_CONTROLLER_TYPE_PS5)
m_haptic_feedback = new HapticFeedback(this);
Maybe it would be better to write a bit more generic code using SDL API-s used for haptics. (for example SDL_HapticEffectSupported
for checking availability)
I see this PR is targeted specifically for PS5 gamepad.
if (parentSet->getInputDevice()->getControllerType() == SDL_GameControllerType::SDL_CONTROLLER_TYPE_PS5) m_haptic_feedback = new HapticFeedback(this);
Maybe it would be better to write a bit more generic code using SDL API-s used for haptics. (for example
SDL_HapticEffectSupported
for checking availability)
SDL_HapticEffect is a very old API from SDL 2.0.0 (2013) to control force feedback joysticks. It can not control the PS5 controllers haptic triggers.
It can not control the PS5 controllers haptic triggers.
You are right ( https://github.com/libsdl-org/SDL/issues/5125 )
You did also a lot of nice cleanups in code :)
Naming in axiseditdialog
is much better now