GCDualSenseAdaptiveTrigger API set trigger mode not working

I'm trying to add support to PS5 DualSense controller. when I try to use the API from here: https://developer.apple.com/documentation/gamecontroller/gcdualsenseadaptivetrigger?language=objc None of the API works, am I missed anything? The code is like this:

			if ( [ controller.extendedGamepad isKindOfClass:[ GCDualSenseGamepad class ] ] )
			{
				GCDualSenseGamepad * dualSenseGamePad = ( GCDualSenseGamepad * )controller.extendedGamepad;

				auto funcSetEffectTrigger = []( TriggerEffectParams& params, GCDualSenseAdaptiveTrigger *trigger ) {
					if ( params.m_mode == TriggerEffectMode::Off )
					{
						[ trigger setModeOff ];
						NSLog(@"setModeOff trigger.mode:%d", trigger.mode );
					}
					else if ( params.m_mode == TriggerEffectMode::Feedback )
					{
						[ trigger setModeFeedbackWithStartPosition: 0.2f resistiveStrength: 0.5f ];
					}
					else if ( params.m_mode == TriggerEffectMode::Weapon )
					{
						[ trigger setModeWeaponWithStartPosition: 0.2f endPosition: 0.4f resistiveStrength: 0.5f ];
					}
					else if ( params.m_mode == TriggerEffectMode::Vibration )
					{
						[ trigger setModeVibrationWithStartPosition: position amplitude: amplitude frequency: frequency ];
					}
				};
				if ( L2 )
				{
					funcSetEffectTrigger( params, dualSenseGamePad.leftTrigger );
				}
				if ( R2 )
				{
					funcSetEffectTrigger( params, dualSenseGamePad.rightTrigger );
				}
			}

I've also tested to add "Game Controllers" capability to Target, still not working. Can't find anything else from the document or forums. I've no idea what need to do.

Just to verify the simplest issues aren’t in play, have you verified that your funcSetEffectTrigger lambda is being executed?

Yes, I've debugged it step by step, and checked the value one by one. One thing I've notice is that after the setModeWeaponWithStartPosition (or setModeFeedbackWithStartPosition), the mode is still 0 (GCDualSenseAdaptiveTriggerModeOff), I don't know if this is normal.

By the way:

  • MacOS: Sequoia 15.2
  • Chip: Apple M1 Ultra

If it metters.

GCDualSenseAdaptiveTrigger API set trigger mode not working
 
 
Q