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.
Post
Replies
Boosts
Views
Activity
We have a game which is original a C++ project, use premake5 generated the XCode project try to ship on App Store.
XCode: 15.4
Destination: Mac macOS
The steps from this page, all checked.
skip_install is set to NO, no dependencies.
My linked libraries don't use a headers build phase
Installation Directory is set to $(LOCAL_APPS_DIR).
https://developer.apple.com/documentation/technotes/tn3110-resolving-generic-xcode-archive-issue
Use Show Package Contents, the screenshot is how it looks, it looks good to me.
Checked the config in Target-> General
Destination(Mac),
Bundle Identifier is set
Version( 1.0 ), Build( 1 ), App Icon( AppIcon )
In Signing & Capabilities, have the Sandbox added.
Use Produce-> Archive to build, but it looks it will try to compile each project for all architectures instead of just arm for me, so I'm using the command line:
"xcodebuild -project /.xcodeproj -scheme -archivePath /Users/name/Documents/test.xcarchive archive" to build it.
and it results successfully build, checked the log, there aren't any wired error or warning.
Checked the Info.plist in the content, compare to a game project generated from Xcode, it looks like the "ApplicationProperties" property is missing, tried to menually modify the Info.plist in the content, add the "ApplicationProperties" property and the infors, then issue doesn't show anymore, but I don't think this can be the solution.
Anything that missing?
Thanks.