Skip to content

GameController macOS xcode13.0 beta3

Manuel de la Pena edited this page Jul 19, 2021 · 3 revisions

#GameController.framework https://github.com/xamarin/xamarin-macios/pull/12144

diff -ruN /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/GameController.framework/Headers/GCDirectionalGamepad.h /Applications/Xcode_13.0.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/GameController.framework/Headers/GCDirectionalGamepad.h
--- /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/GameController.framework/Headers/GCDirectionalGamepad.h	2021-06-17 14:32:21.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/GameController.framework/Headers/GCDirectionalGamepad.h	2021-07-10 09:45:59.000000000 -0400
@@ -15,15 +15,35 @@
  The primary directional input surface for the directional gamepad
  
  @note Equivalent to microgamepad.dpad
+ 
+ @note For the 2021 2nd generation Siri Remote, this represents touching anywhere on the entire touch surface - including the inner and outer rings.
 */
 GAMECONTROLLER_EXTERN NSString *const GCInputDirectionalDpad API_AVAILABLE(macos(11.3), ios(14.5), tvos(14.5));
 
 /**
+ The button corresponding to pressing anywhere on the primary directional input surface for the directional gamepad
+ 
+ @note Equivalent to microgamepad.buttonA
+ 
+ @note For the 2021 2nd generation Siri Remote, this represents pressing anywhere the entire touch surface - including the inner and outer rings.
+*/
+GAMECONTROLLER_EXTERN NSString *const GCInputDirectionalTouchSurfaceButton API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0));
+
+/**
  An optional secondary directional input surface for the directional gamepad. This input is guaranteed to be an 8-way digital dpad with physical Up, Down, Left, Right butttons.
+ 
+ @note For the 2021 2nd generation Siri Remote, this represents pressing on the outer ring of the touch surface.
 */
 GAMECONTROLLER_EXTERN NSString *const GCInputDirectionalCardinalDpad API_AVAILABLE(macos(11.3), ios(14.5), tvos(14.5));
 
 /**
+ An optional button for the directional gamepad. This input represents the center button of the cardinal dpad.
+ 
+ @note For the 2021 2nd generation Siri Remote, this represents pressing anywhere on the inner ring of the touch surface.
+*/
+GAMECONTROLLER_EXTERN NSString *const GCInputDirectionalCenterButton API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0));
+
+/**
  Directional Gamepad profile.
  
  All controller profiles provide a base level of information about the controller they belong to. A directional gamepad
@@ -44,6 +64,8 @@
  @see GCMicroGamepad
  
  @note If you want to use the additional functionality of GCDirectionalGamepad, you should set GCSupportsMultipleMicroGamepads to YES and handle microgamepad connections separately.
+ 
+ @note This profile represents the 2021 2nd generation Siri Remote. Make sure you set GCSupportsMultipleMicroGamepads to YES to properly support the remote.
  */
 API_AVAILABLE(macos(11.1), ios(14.3), tvos(14.3))
 @interface GCDirectionalGamepad : GCMicroGamepad
diff -ruN /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/GameController.framework/Headers/GCMicroGamepad.h /Applications/Xcode_13.0.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/GameController.framework/Headers/GCMicroGamepad.h
--- /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/GameController.framework/Headers/GCMicroGamepad.h	2021-06-17 14:34:58.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/GameController.framework/Headers/GCMicroGamepad.h	2021-07-13 00:35:50.000000000 -0400
@@ -18,6 +18,31 @@
 @class GCControllerButtonInput;
 
 /**
+ The primary directional input surface for the directional gamepad
+ 
+ @note Equivalent to microgamepad.dpad
+ 
+ @note For the 1st generation and 2nd generation Siri Remotes, this represents touching anywhere on the entire touch surface.
+*/
+GAMECONTROLLER_EXTERN NSString *const GCInputMicroGamepadDpad API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0));
+
+/**
+ The primary button for the microgamepad
+ 
+ @note For the 1st generation and 2nd generation Siri Remotes, this represents pressing anywhere on the touch surface.
+*/
+GAMECONTROLLER_EXTERN NSString *const GCInputMicroGamepadButtonA API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0));
+
+/**
+ The secondary button for the microgamepad
+ 
+ @note Equivalent to microgamepad.buttonX
+ 
+ @note For the 1st and 2nd generation Siri Remotes, this represents pressing the play/pause button.
+*/
+GAMECONTROLLER_EXTERN NSString *const GCInputMicroGamepadButtonX API_AVAILABLE(macos(12.0), ios(15.0), tvos(15.0));
+
+/**
  Micro Gamepad profile.
  
  All controller profiles provide a base level of information about the controller they belong to.
diff -ruN /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/GameController.framework/Headers/GCVirtualController.h /Applications/Xcode_13.0.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/GameController.framework/Headers/GCVirtualController.h
--- /Applications/Xcode_13.0.0-beta2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/GameController.framework/Headers/GCVirtualController.h	2021-06-17 14:32:20.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/GameController.framework/Headers/GCVirtualController.h	2021-07-10 09:45:58.000000000 -0400
@@ -20,6 +20,7 @@
  
 */
 API_AVAILABLE(ios(15.0)) API_UNAVAILABLE(macos, tvos)
+NS_SWIFT_NAME(GCVirtualController.Configuration)
 @interface GCVirtualControllerConfiguration : NSObject
  
 // The set of controller elements e.g. [GCInputDirectionPad, GCInputLeftShoulder,  etc...]
@@ -33,12 +34,13 @@
  
 */
 API_AVAILABLE(ios(15.0)) API_UNAVAILABLE(macos, tvos)
+NS_SWIFT_NAME(GCVirtualController.ElementConfiguration)
 @interface GCVirtualControllerElementConfiguration : NSObject
 
 /**
  A Boolean value that determines whether the element is hidden
  */
-@property (nonatomic) BOOL hidden;
+@property (nonatomic, getter=isHidden) BOOL hidden;
 
 /**
  Path that defines custom element image
@@ -50,7 +52,7 @@
  A Boolean value that determines if the thumbstick is acting as a touchpad
  Only supported for thumbsticks
  */
-@property (nonatomic) BOOL touchpad;
+@property (nonatomic) BOOL actsAsTouchpad;
 
 @end
 
@@ -70,18 +72,21 @@
  */
 +(GCVirtualController *)virtualControllerWithConfiguration:(GCVirtualControllerConfiguration *)configuration;
 
--(void)connectWithReply:(void(^ _Nullable )(NSError * _Nullable error))reply;
++(instancetype)new NS_UNAVAILABLE;
+-(instancetype)init NS_UNAVAILABLE;
+-(instancetype)initWithConfiguration:(GCVirtualControllerConfiguration *)configuration NS_DESIGNATED_INITIALIZER;
+
+-(void)connectWithReplyHandler:(void(^ _Nullable )(NSError * _Nullable error))reply NS_SWIFT_ASYNC_NAME(connect());
 
 -(void)disconnect;
 
 
 /**
- GCController is only availible when GCVirtualController is connected
+ GCController is only available when GCVirtualController is connected
  */
 @property (nonatomic, weak, readonly, nullable) GCController *controller;
 
-typedef GCVirtualControllerElementConfiguration* _Nonnull (^GCVirtualControllerElementUpdateBlock)(GCVirtualControllerElementConfiguration* oldConfiguration) API_AVAILABLE(ios(15.0)) API_UNAVAILABLE(macos, tvos);
--(void)changeElement:(NSString*)element configuration:(GCVirtualControllerElementUpdateBlock)config;
+-(void)updateConfigurationForElement:(NSString*)element configuration:( GCVirtualControllerElementConfiguration*(NS_NOESCAPE ^ _Nonnull )(GCVirtualControllerElementConfiguration * oldConfiguration))config ;
 
 @end
 
Clone this wiki locally