Skip to content

GameController iOS xcode15.3 b1

Alex Soto edited this page Jan 27, 2024 · 1 revision

#GameController.framework

diff -ruN /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCAxis2DInput.h /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCAxis2DInput.h
--- /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCAxis2DInput.h	1969-12-31 19:00:00
+++ /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCAxis2DInput.h	2024-01-19 02:49:50
@@ -0,0 +1,89 @@
+//  
+//  GCAxis2DInput.h
+//  GameController
+//
+//  Copyright © 2021 Apple Inc. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import <GameController/GCTypes.h>
+
+@protocol GCPhysicalInputElement;
+@protocol GCPhysicalInputSource;
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ An object conforming to \c GCAxis2DInput represents an input that produces a
+ pair of normalized values - between [-1, 1] - along two axes with fixed origin.
+ The origin - a value of 0 - corresponds the neutral state of the input.
+ */
+API_AVAILABLE(macos(14.3), ios(17.4), tvos(17.4), visionos(1.1))
+@protocol GCAxis2DInput <NSObject>
+
+/**
+ Set this block to be notified when the value of the axis input changes.
+ 
+ @param element the element that has been modified.
+ @param input the input that has been modified.
+ @param value the value the axis was set to at the time the valueChangedHandler fired.
+ */
+@property (atomic, copy, nullable) void (^valueDidChangeHandler)(__kindof id<GCPhysicalInputElement> element, id<GCAxis2DInput> input, GCPoint2 value);
+
+/**
+ A pair of x,y normalized values for the axis input, each between -1 and 1
+ (inclusive). The values are deadzoned and saturated before they are returned
+ so there is no value outside the range.  Deadzoning does not remove values
+ from the range; the full 0 to 1 magnitude of values are possible from the input.
+
+ As an axis is often used in a digital sense, you can rely on a value of 0
+ meaning the axis is inside the deadzone.  Any value greater than or less than
+ zero is not in the deadzone.
+ */
+@property (readonly) GCPoint2 value;
+
+/**
+ Check if the axis can support more than just digital values.
+ 
+ Defaults to \c YES for most axis inputs.
+ */
+@property (readonly, getter = isAnalog) BOOL analog;
+
+/**
+ Check if the axis input value "rolls over" when reaching either the extreme
+ high or low value.  For example, some dials can be rotated past the position
+ that represents their maximum value causing the reported value to roll over.
+ 
+ Defaults to \c NO for most axis elements.
+ */
+@property (readonly) BOOL canWrap;
+
+/**
+ The timestamp of the last value.
+ 
+ This time interval is not relative to any specific point in time.  You can
+ subtract a previous timestamp from the current timestamp to determine the time
+ (in seconds) between changes to the value.
+ */
+@property (readonly) NSTimeInterval lastValueTimestamp;
+
+/**
+ The interval (in seconds) between the timestamp of the last event and the
+ current time.
+ 
+ This should be treated as a lower bound of the event latency.  It may not
+ include (wired or wireless) transmission latency, or latency accrued on
+ the device before the event was transmitted to the host.
+ */
+@property (readonly) NSTimeInterval lastValueLatency;
+
+/**
+ An object describing the physical action(s) the user performs to manipulate
+ this input.
+ */
+@property (copy, readonly) NSSet<id<GCPhysicalInputSource>> *sources;
+
+@end
+
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCDirectionPadElement.h /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCDirectionPadElement.h
--- /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCDirectionPadElement.h	2023-11-12 12:23:30
+++ /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCDirectionPadElement.h	2024-01-19 02:49:50
@@ -8,6 +8,7 @@
 #import <GameController/GCPhysicalInputElement.h>
 #import <GameController/GCLinearInput.h>
 #import <GameController/GCAxisInput.h>
+#import <GameController/GCAxis2DInput.h>
 #import <GameController/GCPressedStateInput.h>
 
 NS_ASSUME_NONNULL_BEGIN
@@ -23,6 +24,9 @@
  */
 API_AVAILABLE(macos(13.0), ios(16.0), tvos(16.0))
 @protocol GCDirectionPadElement <GCPhysicalInputElement>
+
+/** The x,y position of the dpad input. */
+@property (readonly) id<GCAxis2DInput> xyAxes API_AVAILABLE(macos(14.3), ios(17.4), tvos(17.4), visionos(1.1));
 
 /** The horizontal/x-component of the dpad input. */
 @property (readonly) id<GCAxisInput> xAxis;
diff -ruN /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCInputNames.h /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCInputNames.h
--- /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCInputNames.h	2023-10-28 18:03:52
+++ /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCInputNames.h	2024-01-19 03:43:23
@@ -54,12 +54,55 @@
 GAMECONTROLLER_EXTERN GCInputDirectionPadName GCInputLeftThumbstick API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0));
 GAMECONTROLLER_EXTERN GCInputDirectionPadName GCInputRightThumbstick API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0));
 
+GAMECONTROLLER_EXTERN GCInputButtonName GCInputLeftThumbstickButton API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0));
+GAMECONTROLLER_EXTERN GCInputButtonName GCInputRightThumbstickButton API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0));
+
+/*
+ * Shoulder Buttons
+ */
+
 GAMECONTROLLER_EXTERN GCInputButtonName GCInputLeftShoulder API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0));
 GAMECONTROLLER_EXTERN GCInputButtonName GCInputRightShoulder API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0));
+
+/**
+ *  Identifies the button element located at the top-left/right of a gamepad,
+ *  between the left/right shoulder button and the gamepad's horizontal center.
+ */
+GAMECONTROLLER_EXTERN GCInputButtonName GCInputLeftBumper API_AVAILABLE(macos(14.4), ios(17.4), tvos(17.4), visionos(1.1));
+GAMECONTROLLER_EXTERN GCInputButtonName GCInputRightBumper API_AVAILABLE(macos(14.4), ios(17.4), tvos(17.4), visionos(1.1));
+
 GAMECONTROLLER_EXTERN GCInputButtonName GCInputLeftTrigger API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0));
 GAMECONTROLLER_EXTERN GCInputButtonName GCInputRightTrigger API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0));
-GAMECONTROLLER_EXTERN GCInputButtonName GCInputLeftThumbstickButton API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0));
-GAMECONTROLLER_EXTERN GCInputButtonName GCInputRightThumbstickButton API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0));
+
+/*
+ * Back Buttons
+ *
+ * Some gamepads include additional buttons or triggers on their underside.
+ * Because the number and layout of bottom buttons can vary by controller, the
+ * Game Controller framework identifies them by their ease of operation.  The
+ * back left and right buttons at the first position are located nearest the
+ * natural rest position of the user's fingers and are suitable for actions
+ * requiring repeated inputs.  The buttons at the 'second' position may require
+ * the user to move their fingers to press and should be used for less frequent
+ * actions.
+ *
+ * Example view looking at the underside of a gamepad with four back buttons
+ * arranged horizontally:
+ *
+ *     +---------------------------------------------------------------+
+ *     |                       Controller top                          |
+ *     +---------------------------------------------------------------+
+ *     |                                                               |
+ *   R | [(R) 0]  [(R) 1]                             [(L) 1]  [(L) 0] | L
+ *     |                                                               |
+ *     +---------------------------------------------------------------|
+ *     |             Controller bottom (nearest the user)              |
+ *     +---------------------------------------------------------------+
+ */
+
+/* Note: The `position` argument begins at index 0. */
+GAMECONTROLLER_EXTERN GCInputButtonName GCInputBackLeftButton(NSInteger position) NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(14.4), ios(17.4), tvos(17.4), visionos(1.1));
+GAMECONTROLLER_EXTERN GCInputButtonName GCInputBackRightButton(NSInteger position) NS_REFINED_FOR_SWIFT API_AVAILABLE(macos(14.4), ios(17.4), tvos(17.4), visionos(1.1));
 
 GAMECONTROLLER_EXTERN GCInputButtonName GCInputButtonHome API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0));
 GAMECONTROLLER_EXTERN GCInputButtonName GCInputButtonMenu API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0));
diff -ruN /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCKeyboard.h /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCKeyboard.h
--- /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCKeyboard.h	2023-11-12 12:23:31
+++ /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCKeyboard.h	2024-01-19 02:49:51
@@ -5,10 +5,13 @@
 //  Copyright © 2020 Apple Inc. All rights reserved.
 //
 
-#import <GameController/GameController.h>
+#import <Foundation/Foundation.h>
+
 #import <GameController/GCExtern.h>
+#import <GameController/GCDevice.h>
 
-#import <Foundation/Foundation.h>
+@class GCKeyboard;
+@class GCKeyboardInput;
 
 NS_ASSUME_NONNULL_BEGIN
 
@@ -35,7 +38,7 @@
  @note All connected keyboards are coalesced into one keyboard object, so notification about connection/disconnection will only be delivered once.
  */
 API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0))
-@interface GCKeyboard : NSObject<GCDevice>
+@interface GCKeyboard : NSObject <GCDevice>
 
 /**
  Unlike GCController GCKeyboard only has one input profile.
diff -ruN /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCKeyboardInput.h /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCKeyboardInput.h
--- /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCKeyboardInput.h	2023-11-12 12:23:30
+++ /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCKeyboardInput.h	2024-01-19 02:49:50
@@ -5,9 +5,9 @@
 //  Copyright © 2020 Apple Inc. All rights reserved.
 //
 
+#import <Foundation/Foundation.h>
 #import <GameController/GCExtern.h>
 #import <GameController/GCPhysicalInputProfile.h>
-#import <Foundation/Foundation.h>
 
 NS_ASSUME_NONNULL_BEGIN
 
diff -ruN /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCMouseInput.h /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCMouseInput.h
--- /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCMouseInput.h	2023-11-12 12:23:31
+++ /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCMouseInput.h	2024-01-19 02:49:50
@@ -5,11 +5,11 @@
 //  Copyright © 2020 Apple Inc. All rights reserved.
 //
 
+#import <Foundation/Foundation.h>
 #import <GameController/GCExtern.h>
 #import <GameController/GCPhysicalInputProfile.h>
 
 @class GCDeviceCursor;
-#import <Foundation/Foundation.h>
 
 NS_ASSUME_NONNULL_BEGIN
 
diff -ruN /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCTypes.h /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCTypes.h
--- /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCTypes.h	1969-12-31 19:00:00
+++ /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GCTypes.h	2024-01-19 02:49:49
@@ -0,0 +1,42 @@
+//
+//  GCTypes.h
+//  GameController
+//
+//  Copyright © 2020 Apple Inc. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+struct GCPoint2 {
+    float x;
+    float y;
+};
+typedef struct CF_BOXABLE GCPoint2 GCPoint2;
+
+/* The "zero" point -- equivalent to GCPoint2Make(0, 0). */
+GAMECONTROLLER_EXTERN const GCPoint2 GCPoint2Zero API_AVAILABLE(macos(14.3), ios(17.4), tvos(17.4), visionos(1.1));
+
+CF_INLINE GCPoint2
+GCPoint2Make(float x, float y) {
+    GCPoint2 p; p.x = x; p.y = y; return p;
+}
+
+CF_INLINE bool
+GCPoint2Equal(GCPoint2 point1, GCPoint2 point2) {
+    return point1.x == point2.x && point1.y == point2.y;
+}
+
+GAMECONTROLLER_EXTERN NSString* NSStringFromGCPoint2(GCPoint2 point) API_AVAILABLE(macos(14.3), ios(17.4), tvos(17.4), visionos(1.1));
+
+
+@interface NSValue (GCTypes)
+
++ (instancetype)valueWithGCPoint2:(GCPoint2)point API_AVAILABLE(macos(14.3), ios(17.4), tvos(17.4), visionos(1.1));
+
+@property(nonatomic, readonly) GCPoint2 GCPoint2Value API_AVAILABLE(macos(14.3), ios(17.4), tvos(17.4), visionos(1.1));
+
+@end
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GameController.h /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GameController.h
--- /Applications/Xcode_15.2.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GameController.h	2023-11-12 12:23:29
+++ /Applications/Xcode_15.3.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/GameController.framework/Headers/GameController.h	2024-01-19 02:49:49
@@ -9,6 +9,7 @@
 #import <TargetConditionals.h>
 
 #import <GameController/GCExtern.h>
+#import <GameController/GCTypes.h>
 #import <GameController/GCColor.h>
 
 #import <GameController/GCDevice.h>
@@ -18,6 +19,7 @@
 #import <GameController/GCPhysicalInputSource.h>
 #import <GameController/GCLinearInput.h>
 #import <GameController/GCAxisInput.h>
+#import <GameController/GCAxis2DInput.h>
 #import <GameController/GCRelativeInput.h>
 #import <GameController/GCPressedStateInput.h>
 #import <GameController/GCTouchedStateInput.h>
Clone this wiki locally