antimicrox icon indicating copy to clipboard operation
antimicrox copied to clipboard

Add support for DualSense trigger haptic feedback

Open mmmaisel opened this issue 2 years ago • 5 comments

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.

mmmaisel avatar Jul 31 '22 14:07 mmmaisel

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 :)

pktiuk avatar Jul 31 '22 16:07 pktiuk

I extracted it into #504.

mmmaisel avatar Aug 01 '22 15:08 mmmaisel

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)

pktiuk avatar Aug 02 '22 20:08 pktiuk

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.

mmmaisel avatar Aug 03 '22 15:08 mmmaisel

It can not control the PS5 controllers haptic triggers.

You are right ( https://github.com/libsdl-org/SDL/issues/5125 )

pktiuk avatar Aug 03 '22 17:08 pktiuk

You did also a lot of nice cleanups in code :)
Naming in axiseditdialog is much better now

pktiuk avatar Aug 13 '22 12:08 pktiuk