Documentation
¶
Overview ¶
Package gamecontroller provides Go bindings for the GameController framework.
Support hardware game controllers in your game.
Use Game Controller to support users interacting with your app using a physical or virtual game controller. Game controllers include third-party products, such as the DualShock 4, DualSense, and Xbox, as well as the mouse, keyboard, Siri Remote, and racing wheels.
Essentials ¶
- Game Controller updates: Learn about important changes to Game Controller.
- Discovering game controllers: Implement connection and input handling to provide seamless physical controller support for players.
- Handling input events: Receive controller input using either polling or callbacks.
Configuration ¶
- GCSupportsControllerUserInteraction: A Boolean value indicating whether the app supports a game controller.
- GCSupportedGameControllers: The types of game controller profiles that the app supports or requires.
- GCSupportsMultipleMicroGamepads: A Boolean value indicating whether the physical Apple TV Remote and the Apple TV Remote app operate as separate game controllers.
View controller ¶
- GCEventViewController: A view controller that delivers input either from the responder chain to views, or from game controllers to profiles.
Game controllers ¶
- Supporting Game Controllers: Support a physical controller or add a virtual controller to enhance how people interact with your game through haptics, lighting, and motion sensing.
- Letting players use their second-generation Siri Remote as a game controller: Support the second-generation Siri Remote as a game controller in your Apple TV game.
- Discovering and tracking spatial game controllers and styli: Receive controller and stylus input to interact with content in your augmented reality app.
- GCDevice: A protocol that defines a common interface for game input devices.
- GCController: A representation of a real game controller, a virtual controller, or a snapshot of a controller. (GCControllerLiveInput, GCControllerInputState, GCPhysicalInputProfile, GCKeyboardInput, GCMouseInput)
- GCRacingWheel: An object that represents a physical racing wheel controller connected to a device.
- GCKeyboard: An object that represents a physical keyboard connected to a device.
- GCMouse: An object that represents a physical mouse connected to a device.
- GCStylus: An object that represents a physical stylus connected to the device.
Game controller profiles ¶
- Input: Receive controller input in the way that best integrates with the flow of your game or game engine. (GCDevicePhysicalInput, GCDevicePhysicalInputState, GCDevicePhysicalInputStateDiff, GCPhysicalInputElementCollection, GCPhysicalInputElement)
- GCMotion: A controller profile that supports orientation and motion. (GCMotionValueChangedHandler, GCQuaternion, GCRotationRate, GCEulerAngles, GCAcceleration)
- GCDeviceBattery: The charge level and state of a device’s battery.
- GCDeviceHaptics: The locations of haptic actuators on a game controller. (GCHapticsLocality)
- GCDeviceLight: The colored light on a device. (GCColor)
Virtual controller ¶
- Adding virtual controls to games that support game controllers in iOS: Use touch input and virtual controllers to make your game available to players without controllers.
- GCVirtualController: A software emulation of a real controller that you configure specifically for your game.
Button elements and names ¶
- GCTouchedStateInput: The common properties for an element that has touch state input.
- GCPressedStateInput: The common properties for an element that has press state input, such as input from a button.
Racing wheels ¶
- Racing wheel device support: Add support for racing wheel devices in macOS. (GCRacingWheel, GCRacingWheelInput, GCRacingWheelInputState, GCAxisInput, GCGearShifterElement)
Game Controller framework migration from IOKit ¶
- Understanding game controller backward compatibility: Learn how macOS brings support for the latest game controllers to software that predates the introduction of the Game Controller framework.
- kIOHIDGCSyntheticDeviceKey: A key that specifies whether the device is a game controller synthetic HID device.
Aliases for backward compatibility ¶
- GCDeviceElement: An alias for a symbol name for backward compatibility with a previous SDK version.
- GCDeviceAxisInput: An alias for a symbol name for backward compatibility with a previous SDK version.
- GCDeviceButtonInput: An alias for a symbol name for backward compatibility with a previous SDK version.
- GCDeviceTouchpad: An alias for a symbol name for backward compatibility with a previous SDK version.
- GCDeviceDirectionPad: An alias for a symbol name for backward compatibility with a previous SDK version.
Protocols ¶
- GCPhysicalInputExtents: Physical extents scale the normalized value reported by into physical units.
Key Types ¶
- GCController - A representation of a real game controller, a virtual controller, or a snapshot of a controller.
- GCPhysicalInputProfile - The base class for controller profiles that support physical buttons, thumbsticks, and directional pads.
- GCExtendedGamepad - A controller profile that supports the extended set of gamepad controls.
- GCControllerLiveInput - The input profile for a controller.
- GCMotion - A controller profile that supports orientation and motion.
- GCRacingWheelInput - A controller profile that supports a racing wheel.
- GCRacingWheelInputState - The input for the wheel of a racing wheel controller.
- GCRacingWheel - An object that represents a physical racing wheel controller connected to a device.
- GCMicroGamepad - A controller profile that supports the Siri Remote.
- GCMouse - An object that represents a physical mouse connected to a device.
Code generated from Apple documentation. DO NOT EDIT.
Index ¶
- Variables
- func NSStringFromGCPoint2(point GCPoint2) foundation.NSString
- func NewGCDevicePhysicalInputBlock(handler GCDevicePhysicalInputHandler) (objc.ID, func())
- func NewGCPhysicalInputProfileGCControllerElementBlock(handler GCPhysicalInputProfileGCControllerElementHandler) (objc.ID, func())
- func NewVoidBlock(handler VoidHandler) (objc.ID, func())
- type GCAcceleration
- type GCAxis2DInput
- type GCAxis2DInputObject
- func (o GCAxis2DInputObject) BaseObject() objectivec.Object
- func (o GCAxis2DInputObject) CanWrap() bool
- func (o GCAxis2DInputObject) IsAnalog() bool
- func (o GCAxis2DInputObject) LastValueLatency() float64
- func (o GCAxis2DInputObject) LastValueTimestamp() float64
- func (o GCAxis2DInputObject) Sources() foundation.INSSet
- func (o GCAxis2DInputObject) Value() GCPoint2
- func (o GCAxis2DInputObject) ValueDidChangeHandler() func(objc.ID, unsafe.Pointer)
- type GCAxisElement
- type GCAxisElementName
- type GCAxisElementNameObject
- type GCAxisElementObject
- func (o GCAxisElementObject) AbsoluteInput() GCAxisInput
- func (o GCAxisElementObject) Aliases() foundation.INSSet
- func (o GCAxisElementObject) BaseObject() objectivec.Object
- func (o GCAxisElementObject) LocalizedName() string
- func (o GCAxisElementObject) RelativeInput() GCRelativeInput
- func (o GCAxisElementObject) SfSymbolsName() string
- type GCAxisInput
- type GCAxisInputObject
- func (o GCAxisInputObject) BaseObject() objectivec.Object
- func (o GCAxisInputObject) CanWrap() bool
- func (o GCAxisInputObject) IsAnalog() bool
- func (o GCAxisInputObject) LastValueLatency() float64
- func (o GCAxisInputObject) LastValueTimestamp() float64
- func (o GCAxisInputObject) Sources() foundation.INSSet
- func (o GCAxisInputObject) Value() float32
- func (o GCAxisInputObject) ValueDidChangeHandler() func(objc.ID, float32)
- type GCButtonElement
- type GCButtonElementName
- type GCButtonElementNameObject
- type GCButtonElementObject
- func (o GCButtonElementObject) Aliases() foundation.INSSet
- func (o GCButtonElementObject) BaseObject() objectivec.Object
- func (o GCButtonElementObject) ForceInput() GCLinearInput
- func (o GCButtonElementObject) LocalizedName() string
- func (o GCButtonElementObject) PressedInput() objectivec.IObject
- func (o GCButtonElementObject) SfSymbolsName() string
- func (o GCButtonElementObject) TouchedInput() GCTouchedStateInput
- type GCColor
- func (g GCColor) Autorelease() GCColor
- func (g GCColor) Blue() float32
- func (g GCColor) Color() IGCColor
- func (g GCColor) EncodeWithCoder(coder foundation.INSCoder)
- func (g GCColor) Green() float32
- func (g GCColor) Init() GCColor
- func (g GCColor) InitWithRedGreenBlue(red float32, green float32, blue float32) GCColor
- func (g GCColor) Red() float32
- func (g GCColor) SetColor(value IGCColor)
- type GCColorClass
- type GCController
- func (g GCController) AttachedToDevice() bool
- func (g GCController) Autorelease() GCController
- func (g GCController) Battery() IGCDeviceBattery
- func (g GCController) Capture() IGCController
- func (g GCController) ExtendedGamepad() IGCExtendedGamepad
- func (g GCController) GCControllerDidBecomeCurrent() foundation.NSString
- func (g GCController) GCControllerDidConnect() foundation.NSString
- func (g GCController) GCControllerDidDisconnect() foundation.NSString
- func (g GCController) GCControllerDidStopBeingCurrent() foundation.NSString
- func (g GCController) HandlerQueue() dispatch.Queue
- func (g GCController) Haptics() IGCDeviceHaptics
- func (g GCController) Init() GCController
- func (g GCController) Input() IGCControllerLiveInput
- func (g GCController) LeftThumbstick() IGCControllerDirectionPad
- func (g GCController) Light() IGCDeviceLight
- func (g GCController) MicroGamepad() IGCMicroGamepad
- func (g GCController) Motion() IGCMotion
- func (g GCController) PhysicalInputProfile() IGCPhysicalInputProfile
- func (g GCController) PlayerIndex() GCControllerPlayerIndex
- func (g GCController) ProductCategory() string
- func (g GCController) SetHandlerQueue(value dispatch.Queue)
- func (g GCController) SetLeftThumbstick(value IGCControllerDirectionPad)
- func (g GCController) SetPlayerIndex(value GCControllerPlayerIndex)
- func (g GCController) SetValueChangedHandler(value GCExtendedGamepadValueChangedHandler)
- func (g GCController) Snapshot() bool
- func (g GCController) ValueChangedHandler() GCExtendedGamepadValueChangedHandler
- func (g GCController) VendorName() string
- type GCControllerAxisInput
- func (g GCControllerAxisInput) Autorelease() GCControllerAxisInput
- func (g GCControllerAxisInput) Init() GCControllerAxisInput
- func (g GCControllerAxisInput) SetValueChangedHandler(value GCControllerAxisValueChangedHandler)
- func (g GCControllerAxisInput) Value() float32
- func (g GCControllerAxisInput) ValueChangedHandler() GCControllerAxisValueChangedHandler
- type GCControllerAxisInputClass
- type GCControllerAxisValueChangedHandler
- type GCControllerButtonInput
- func (g GCControllerButtonInput) Autorelease() GCControllerButtonInput
- func (g GCControllerButtonInput) Init() GCControllerButtonInput
- func (g GCControllerButtonInput) Pressed() bool
- func (g GCControllerButtonInput) PressedChangedHandler() GCControllerButtonValueChangedHandler
- func (g GCControllerButtonInput) SetPressedChangedHandler(value GCControllerButtonValueChangedHandler)
- func (g GCControllerButtonInput) SetTouchedChangedHandler(value GCControllerButtonTouchedChangedHandler)
- func (g GCControllerButtonInput) SetValueChangedHandler(value GCControllerButtonValueChangedHandler)
- func (g GCControllerButtonInput) Touched() bool
- func (g GCControllerButtonInput) TouchedChangedHandler() GCControllerButtonTouchedChangedHandler
- func (g GCControllerButtonInput) Value() float32
- func (g GCControllerButtonInput) ValueChangedHandler() GCControllerButtonValueChangedHandler
- type GCControllerButtonInputClass
- type GCControllerButtonTouchedChangedHandler
- type GCControllerButtonValueChangedHandler
- type GCControllerClass
- func (gc GCControllerClass) Alloc() GCController
- func (gc GCControllerClass) Class() objc.Class
- func (_GCControllerClass GCControllerClass) ControllerWithExtendedGamepad() GCController
- func (_GCControllerClass GCControllerClass) ControllerWithMicroGamepad() GCController
- func (_GCControllerClass GCControllerClass) Controllers() []GCController
- func (_GCControllerClass GCControllerClass) Current() GCController
- func (_GCControllerClass GCControllerClass) SetShouldMonitorBackgroundEvents(value bool)
- func (_GCControllerClass GCControllerClass) ShouldMonitorBackgroundEvents() bool
- func (gc GCControllerClass) StartWirelessControllerDiscovery(ctx context.Context) error
- func (_GCControllerClass GCControllerClass) StartWirelessControllerDiscoveryWithCompletionHandler(completionHandler VoidHandler)
- func (_GCControllerClass GCControllerClass) StopWirelessControllerDiscovery()
- func (_GCControllerClass GCControllerClass) SupportsHIDDevice(device iokit.IOHIDDeviceRef) bool
- type GCControllerDirectionPad
- func (g GCControllerDirectionPad) Autorelease() GCControllerDirectionPad
- func (g GCControllerDirectionPad) Down() IGCControllerButtonInput
- func (g GCControllerDirectionPad) Init() GCControllerDirectionPad
- func (g GCControllerDirectionPad) Left() IGCControllerButtonInput
- func (g GCControllerDirectionPad) Right() IGCControllerButtonInput
- func (g GCControllerDirectionPad) SetValueChangedHandler(value GCControllerDirectionPadValueChangedHandler)
- func (g GCControllerDirectionPad) SetValueForXAxisYAxis(xAxis float32, yAxis float32)
- func (g GCControllerDirectionPad) Up() IGCControllerButtonInput
- func (g GCControllerDirectionPad) ValueChangedHandler() GCControllerDirectionPadValueChangedHandler
- func (g GCControllerDirectionPad) XAxis() IGCControllerAxisInput
- func (g GCControllerDirectionPad) YAxis() IGCControllerAxisInput
- type GCControllerDirectionPadClass
- type GCControllerDirectionPadValueChangedHandler
- type GCControllerElement
- func (g GCControllerElement) Aliases() foundation.INSSet
- func (g GCControllerElement) Analog() bool
- func (g GCControllerElement) Autorelease() GCControllerElement
- func (g GCControllerElement) BoundToSystemGesture() bool
- func (g GCControllerElement) Collection() IGCControllerElement
- func (g GCControllerElement) Init() GCControllerElement
- func (g GCControllerElement) LocalizedName() string
- func (g GCControllerElement) PreferredSystemGestureState() GCSystemGestureState
- func (g GCControllerElement) SetLocalizedName(value string)
- func (g GCControllerElement) SetPreferredSystemGestureState(value GCSystemGestureState)
- func (g GCControllerElement) SetSfSymbolsName(value string)
- func (g GCControllerElement) SetUnmappedLocalizedName(value string)
- func (g GCControllerElement) SetUnmappedSfSymbolsName(value string)
- func (g GCControllerElement) SfSymbolsName() string
- func (g GCControllerElement) UnmappedLocalizedName() string
- func (g GCControllerElement) UnmappedSfSymbolsName() string
- type GCControllerElementClass
- type GCControllerInputState
- func (g GCControllerInputState) Autorelease() GCControllerInputState
- func (g GCControllerInputState) Device() GCDevice
- func (g GCControllerInputState) Init() GCControllerInputState
- func (g GCControllerInputState) Input() IGCControllerLiveInput
- func (g GCControllerInputState) LastEventLatency() float64
- func (g GCControllerInputState) LastEventTimestamp() float64
- func (g GCControllerInputState) ObjectForKeyedSubscript(key string) GCPhysicalInputElement
- func (g GCControllerInputState) SetInput(value IGCControllerLiveInput)
- type GCControllerInputStateClass
- type GCControllerLiveInput
- func (g GCControllerLiveInput) Autorelease() GCControllerLiveInput
- func (g GCControllerLiveInput) Capture() IGCControllerInputState
- func (g GCControllerLiveInput) ElementValueDidChangeHandler() VoidHandler
- func (g GCControllerLiveInput) Init() GCControllerLiveInput
- func (g GCControllerLiveInput) InputStateAvailableHandler() GCDevicePhysicalInputHandler
- func (g GCControllerLiveInput) InputStateQueueDepth() int
- func (g GCControllerLiveInput) NextInputState() IGCControllerInputState
- func (g GCControllerLiveInput) Queue() dispatch.Queue
- func (g GCControllerLiveInput) SetElementValueDidChangeHandler(value VoidHandler)
- func (g GCControllerLiveInput) SetInputStateAvailableHandler(value GCDevicePhysicalInputHandler)
- func (g GCControllerLiveInput) SetInputStateQueueDepth(value int)
- func (g GCControllerLiveInput) SetQueue(value dispatch.Queue)
- func (g GCControllerLiveInput) UnmappedInput() IGCControllerLiveInput
- type GCControllerLiveInputClass
- type GCControllerPlayerIndex
- type GCControllerTouchpad
- func (g GCControllerTouchpad) Autorelease() GCControllerTouchpad
- func (g GCControllerTouchpad) Button() IGCControllerButtonInput
- func (g GCControllerTouchpad) Init() GCControllerTouchpad
- func (g GCControllerTouchpad) ReportsAbsoluteTouchSurfaceValues() bool
- func (g GCControllerTouchpad) SetReportsAbsoluteTouchSurfaceValues(value bool)
- func (g GCControllerTouchpad) SetTouchDown(value GCControllerTouchpadHandler)
- func (g GCControllerTouchpad) SetTouchMoved(value GCControllerTouchpadHandler)
- func (g GCControllerTouchpad) SetTouchUp(value GCControllerTouchpadHandler)
- func (g GCControllerTouchpad) SetValueForXAxisYAxisTouchDownButtonValue(xAxis float32, yAxis float32, touchDown bool, buttonValue float32)
- func (g GCControllerTouchpad) TouchDown() GCControllerTouchpadHandler
- func (g GCControllerTouchpad) TouchMoved() GCControllerTouchpadHandler
- func (g GCControllerTouchpad) TouchState() GCTouchState
- func (g GCControllerTouchpad) TouchSurface() IGCControllerDirectionPad
- func (g GCControllerTouchpad) TouchUp() GCControllerTouchpadHandler
- type GCControllerTouchpadClass
- type GCControllerTouchpadHandler
- type GCDevice
- type GCDeviceBattery
- type GCDeviceBatteryClass
- type GCDeviceBatteryState
- type GCDeviceCursor
- type GCDeviceCursorClass
- type GCDeviceHaptics
- func (g GCDeviceHaptics) Autorelease() GCDeviceHaptics
- func (g GCDeviceHaptics) CreateEngineWithLocality(locality GCHapticsLocality) unsafe.Pointer
- func (g GCDeviceHaptics) GCHapticDurationInfinite() float32
- func (g GCDeviceHaptics) Init() GCDeviceHaptics
- func (g GCDeviceHaptics) SetSupportsHaptics(value bool)
- func (g GCDeviceHaptics) SupportedLocalities() foundation.INSSet
- func (g GCDeviceHaptics) SupportsHaptics() bool
- type GCDeviceHapticsClass
- type GCDeviceLight
- type GCDeviceLightClass
- type GCDeviceObject
- func (o GCDeviceObject) BaseObject() objectivec.Object
- func (o GCDeviceObject) HandlerQueue() dispatch.Queue
- func (o GCDeviceObject) PhysicalInputProfile() IGCPhysicalInputProfile
- func (o GCDeviceObject) ProductCategory() string
- func (o GCDeviceObject) SetHandlerQueue(value dispatch.Queue)
- func (o GCDeviceObject) VendorName() string
- type GCDevicePhysicalInput
- type GCDevicePhysicalInputElementChange
- type GCDevicePhysicalInputHandler
- type GCDevicePhysicalInputObject
- func (o GCDevicePhysicalInputObject) BaseObject() objectivec.Object
- func (o GCDevicePhysicalInputObject) Capture() GCDevicePhysicalInputState
- func (o GCDevicePhysicalInputObject) Device() GCDevice
- func (o GCDevicePhysicalInputObject) ElementValueDidChangeHandler() func(objc.ID)
- func (o GCDevicePhysicalInputObject) InputStateAvailableHandler() func(objc.ID)
- func (o GCDevicePhysicalInputObject) InputStateQueueDepth() int
- func (o GCDevicePhysicalInputObject) LastEventLatency() float64
- func (o GCDevicePhysicalInputObject) LastEventTimestamp() float64
- func (o GCDevicePhysicalInputObject) NextInputState() objectivec.IObject
- func (o GCDevicePhysicalInputObject) ObjectForKeyedSubscript(key string) GCPhysicalInputElement
- func (o GCDevicePhysicalInputObject) Queue() dispatch.Queue
- func (o GCDevicePhysicalInputObject) SetInputStateQueueDepth(value int)
- func (o GCDevicePhysicalInputObject) SetQueue(value dispatch.Queue)
- type GCDevicePhysicalInputState
- type GCDevicePhysicalInputStateDiff
- type GCDevicePhysicalInputStateDiffObject
- type GCDevicePhysicalInputStateObject
- func (o GCDevicePhysicalInputStateObject) BaseObject() objectivec.Object
- func (o GCDevicePhysicalInputStateObject) Device() GCDevice
- func (o GCDevicePhysicalInputStateObject) LastEventLatency() float64
- func (o GCDevicePhysicalInputStateObject) LastEventTimestamp() float64
- func (o GCDevicePhysicalInputStateObject) ObjectForKeyedSubscript(key string) GCPhysicalInputElement
- type GCDirectionPadElement
- type GCDirectionPadElementName
- type GCDirectionPadElementNameObject
- type GCDirectionPadElementObject
- func (o GCDirectionPadElementObject) Aliases() foundation.INSSet
- func (o GCDirectionPadElementObject) BaseObject() objectivec.Object
- func (o GCDirectionPadElementObject) Down() objectivec.IObject
- func (o GCDirectionPadElementObject) Left() objectivec.IObject
- func (o GCDirectionPadElementObject) LocalizedName() string
- func (o GCDirectionPadElementObject) Right() objectivec.IObject
- func (o GCDirectionPadElementObject) SfSymbolsName() string
- func (o GCDirectionPadElementObject) Up() objectivec.IObject
- func (o GCDirectionPadElementObject) XAxis() GCAxisInput
- func (o GCDirectionPadElementObject) XyAxes() GCAxis2DInput
- func (o GCDirectionPadElementObject) YAxis() GCAxisInput
- type GCDirectionalGamepad
- type GCDirectionalGamepadClass
- type GCDualSenseAdaptiveTrigger
- func (g GCDualSenseAdaptiveTrigger) ArmPosition() float32
- func (g GCDualSenseAdaptiveTrigger) Autorelease() GCDualSenseAdaptiveTrigger
- func (g GCDualSenseAdaptiveTrigger) Init() GCDualSenseAdaptiveTrigger
- func (g GCDualSenseAdaptiveTrigger) Mode() GCDualSenseAdaptiveTriggerMode
- func (g GCDualSenseAdaptiveTrigger) SetModeFeedbackWithResistiveStrengths(...)
- func (g GCDualSenseAdaptiveTrigger) SetModeFeedbackWithStartPositionResistiveStrength(startPosition float32, resistiveStrength float32)
- func (g GCDualSenseAdaptiveTrigger) SetModeOff()
- func (g GCDualSenseAdaptiveTrigger) SetModeSlopeFeedbackWithStartPositionEndPositionStartStrengthEndStrength(startPosition float32, endPosition float32, startStrength float32, ...)
- func (g GCDualSenseAdaptiveTrigger) SetModeVibrationWithAmplitudesFrequency(positionalAmplitudes GCDualSenseAdaptiveTriggerPositionalAmplitudes, ...)
- func (g GCDualSenseAdaptiveTrigger) SetModeVibrationWithStartPositionAmplitudeFrequency(startPosition float32, amplitude float32, frequency float32)
- func (g GCDualSenseAdaptiveTrigger) SetModeWeaponWithStartPositionEndPositionResistiveStrength(startPosition float32, endPosition float32, resistiveStrength float32)
- func (g GCDualSenseAdaptiveTrigger) Status() GCDualSenseAdaptiveTriggerStatus
- type GCDualSenseAdaptiveTriggerClass
- type GCDualSenseAdaptiveTriggerDiscretePositionCountConstants
- type GCDualSenseAdaptiveTriggerMode
- type GCDualSenseAdaptiveTriggerPositionalAmplitudes
- type GCDualSenseAdaptiveTriggerPositionalResistiveStrengths
- type GCDualSenseAdaptiveTriggerStatus
- type GCDualSenseGamepad
- func (g GCDualSenseGamepad) Autorelease() GCDualSenseGamepad
- func (g GCDualSenseGamepad) Init() GCDualSenseGamepad
- func (g GCDualSenseGamepad) TouchpadButton() IGCControllerButtonInput
- func (g GCDualSenseGamepad) TouchpadPrimary() IGCControllerDirectionPad
- func (g GCDualSenseGamepad) TouchpadSecondary() IGCControllerDirectionPad
- type GCDualSenseGamepadClass
- type GCDualShockGamepad
- func (g GCDualShockGamepad) Autorelease() GCDualShockGamepad
- func (g GCDualShockGamepad) Init() GCDualShockGamepad
- func (g GCDualShockGamepad) TouchpadButton() IGCControllerButtonInput
- func (g GCDualShockGamepad) TouchpadPrimary() IGCControllerDirectionPad
- func (g GCDualShockGamepad) TouchpadSecondary() IGCControllerDirectionPad
- type GCDualShockGamepadClass
- type GCEulerAngles
- type GCEventViewController
- type GCEventViewControllerClass
- type GCExtendedGamepad
- func (g GCExtendedGamepad) Autorelease() GCExtendedGamepad
- func (g GCExtendedGamepad) ButtonA() IGCControllerButtonInput
- func (g GCExtendedGamepad) ButtonB() IGCControllerButtonInput
- func (g GCExtendedGamepad) ButtonHome() IGCControllerButtonInput
- func (g GCExtendedGamepad) ButtonMenu() IGCControllerButtonInput
- func (g GCExtendedGamepad) ButtonOptions() IGCControllerButtonInput
- func (g GCExtendedGamepad) ButtonX() IGCControllerButtonInput
- func (g GCExtendedGamepad) ButtonY() IGCControllerButtonInput
- func (g GCExtendedGamepad) Controller() IGCController
- func (g GCExtendedGamepad) Dpad() IGCControllerDirectionPad
- func (g GCExtendedGamepad) Init() GCExtendedGamepad
- func (g GCExtendedGamepad) LeftShoulder() IGCControllerButtonInput
- func (g GCExtendedGamepad) LeftThumbstick() IGCControllerDirectionPad
- func (g GCExtendedGamepad) LeftThumbstickButton() IGCControllerButtonInput
- func (g GCExtendedGamepad) LeftTrigger() IGCControllerButtonInput
- func (g GCExtendedGamepad) RightShoulder() IGCControllerButtonInput
- func (g GCExtendedGamepad) RightThumbstick() IGCControllerDirectionPad
- func (g GCExtendedGamepad) RightThumbstickButton() IGCControllerButtonInput
- func (g GCExtendedGamepad) RightTrigger() IGCControllerButtonInput
- func (g GCExtendedGamepad) SetStateFromExtendedGamepad(extendedGamepad IGCExtendedGamepad)
- func (g GCExtendedGamepad) SetValueChangedHandler(value GCExtendedGamepadValueChangedHandler)
- func (g GCExtendedGamepad) ValueChangedHandler() GCExtendedGamepadValueChangedHandler
- type GCExtendedGamepadClass
- type GCExtendedGamepadSnapShotDataV100
- type GCExtendedGamepadSnapshotData
- type GCExtendedGamepadSnapshotDataVersion
- type GCExtendedGamepadValueChangedHandler
- type GCGamepadSnapShotDataV100
- type GCGamepadValueChangedHandler
- type GCGearShifterElement
- func (g GCGearShifterElement) Aliases() foundation.INSSet
- func (g GCGearShifterElement) Autorelease() GCGearShifterElement
- func (g GCGearShifterElement) Init() GCGearShifterElement
- func (g GCGearShifterElement) LocalizedName() string
- func (g GCGearShifterElement) PatternInput() GCSwitchPositionInput
- func (g GCGearShifterElement) SequentialInput() GCRelativeInput
- func (g GCGearShifterElement) SfSymbolsName() string
- type GCGearShifterElementClass
- type GCHapticsLocality
- type GCInputAxisName
- type GCInputButtonName
- type GCInputDirectionPadName
- type GCInputElementName
- type GCInputSwitchName
- type GCKeyCode
- type GCKeyboard
- func (g GCKeyboard) Autorelease() GCKeyboard
- func (g GCKeyboard) GCKeyboardDidConnect() foundation.NSString
- func (g GCKeyboard) GCKeyboardDidDisconnect() foundation.NSString
- func (g GCKeyboard) HandlerQueue() dispatch.Queue
- func (g GCKeyboard) Init() GCKeyboard
- func (g GCKeyboard) KeyboardInput() IGCKeyboardInput
- func (g GCKeyboard) PhysicalInputProfile() IGCPhysicalInputProfile
- func (g GCKeyboard) ProductCategory() string
- func (g GCKeyboard) SetHandlerQueue(value dispatch.Queue)
- func (g GCKeyboard) VendorName() string
- type GCKeyboardClass
- type GCKeyboardInput
- func (g GCKeyboardInput) AnyKeyPressed() bool
- func (g GCKeyboardInput) Autorelease() GCKeyboardInput
- func (g GCKeyboardInput) ButtonForKeyCode(code GCKeyCode) IGCControllerButtonInput
- func (g GCKeyboardInput) Init() GCKeyboardInput
- func (g GCKeyboardInput) KeyChangedHandler() GCKeyboardValueChangedHandler
- func (g GCKeyboardInput) SetKeyChangedHandler(value GCKeyboardValueChangedHandler)
- type GCKeyboardInputClass
- type GCKeyboardValueChangedHandler
- type GCLinearInput
- type GCLinearInputObject
- func (o GCLinearInputObject) BaseObject() objectivec.Object
- func (o GCLinearInputObject) CanWrap() bool
- func (o GCLinearInputObject) IsAnalog() bool
- func (o GCLinearInputObject) LastValueLatency() float64
- func (o GCLinearInputObject) LastValueTimestamp() float64
- func (o GCLinearInputObject) PhysicalExtents() GCPhysicalInputExtents
- func (o GCLinearInputObject) Sources() foundation.INSSet
- func (o GCLinearInputObject) Value() float32
- func (o GCLinearInputObject) ValueDidChangeHandler() func(objc.ID, float32)
- type GCMicroGamepad
- func (g GCMicroGamepad) AllowsRotation() bool
- func (g GCMicroGamepad) Autorelease() GCMicroGamepad
- func (g GCMicroGamepad) ButtonA() IGCControllerButtonInput
- func (g GCMicroGamepad) ButtonMenu() IGCControllerButtonInput
- func (g GCMicroGamepad) ButtonX() IGCControllerButtonInput
- func (g GCMicroGamepad) Controller() IGCController
- func (g GCMicroGamepad) Dpad() IGCControllerDirectionPad
- func (g GCMicroGamepad) Init() GCMicroGamepad
- func (g GCMicroGamepad) ReportsAbsoluteDpadValues() bool
- func (g GCMicroGamepad) SetAllowsRotation(value bool)
- func (g GCMicroGamepad) SetReportsAbsoluteDpadValues(value bool)
- func (g GCMicroGamepad) SetStateFromMicroGamepad(microGamepad IGCMicroGamepad)
- func (g GCMicroGamepad) SetValueChangedHandler(value GCMicroGamepadValueChangedHandler)
- func (g GCMicroGamepad) ValueChangedHandler() GCMicroGamepadValueChangedHandler
- type GCMicroGamepadClass
- type GCMicroGamepadSnapShotDataV100
- type GCMicroGamepadSnapshotData
- type GCMicroGamepadSnapshotDataVersion
- type GCMicroGamepadValueChangedHandler
- type GCMotion
- func (g GCMotion) Acceleration() GCAcceleration
- func (g GCMotion) Attitude() GCQuaternion
- func (g GCMotion) Autorelease() GCMotion
- func (g GCMotion) Controller() IGCController
- func (g GCMotion) Gravity() GCAcceleration
- func (g GCMotion) HasAttitude() bool
- func (g GCMotion) HasGravityAndUserAcceleration() bool
- func (g GCMotion) HasRotationRate() bool
- func (g GCMotion) Init() GCMotion
- func (g GCMotion) Motion() IGCMotion
- func (g GCMotion) RotationRate() GCRotationRate
- func (g GCMotion) SensorsActive() bool
- func (g GCMotion) SensorsRequireManualActivation() bool
- func (g GCMotion) SetMotion(value IGCMotion)
- func (g GCMotion) SetSensorsActive(value bool)
- func (g GCMotion) SetStateFromMotion(motion IGCMotion)
- func (g GCMotion) SetValueChangedHandler(value GCMotionValueChangedHandler)
- func (g GCMotion) UserAcceleration() GCAcceleration
- func (g GCMotion) ValueChangedHandler() GCMotionValueChangedHandler
- type GCMotionClass
- type GCMotionValueChangedHandler
- type GCMouse
- func (g GCMouse) Autorelease() GCMouse
- func (g GCMouse) GCMouseDidBecomeCurrent() foundation.NSString
- func (g GCMouse) GCMouseDidConnect() foundation.NSString
- func (g GCMouse) GCMouseDidDisconnect() foundation.NSString
- func (g GCMouse) GCMouseDidStopBeingCurrent() foundation.NSString
- func (g GCMouse) HandlerQueue() dispatch.Queue
- func (g GCMouse) Init() GCMouse
- func (g GCMouse) MouseInput() IGCMouseInput
- func (g GCMouse) PhysicalInputProfile() IGCPhysicalInputProfile
- func (g GCMouse) ProductCategory() string
- func (g GCMouse) SetHandlerQueue(value dispatch.Queue)
- func (g GCMouse) VendorName() string
- type GCMouseClass
- type GCMouseInput
- func (g GCMouseInput) Autorelease() GCMouseInput
- func (g GCMouseInput) AuxiliaryButtons() []GCControllerButtonInput
- func (g GCMouseInput) Init() GCMouseInput
- func (g GCMouseInput) LeftButton() IGCControllerButtonInput
- func (g GCMouseInput) MiddleButton() IGCControllerButtonInput
- func (g GCMouseInput) MouseMovedHandler() GCMouseMoved
- func (g GCMouseInput) RightButton() IGCControllerButtonInput
- func (g GCMouseInput) Scroll() IGCDeviceCursor
- func (g GCMouseInput) SetMouseMovedHandler(value GCMouseMoved)
- type GCMouseInputClass
- type GCMouseMoved
- type GCPhysicalInputElement
- type GCPhysicalInputElementCollection
- func (g GCPhysicalInputElementCollection) Autorelease() GCPhysicalInputElementCollection
- func (g GCPhysicalInputElementCollection) Count() uint
- func (g GCPhysicalInputElementCollection) ElementEnumerator() foundation.NSEnumerator
- func (g GCPhysicalInputElementCollection) ElementForAlias(alias coreservices.Key) objectivec.IObject
- func (g GCPhysicalInputElementCollection) Init() GCPhysicalInputElementCollection
- func (g GCPhysicalInputElementCollection) ObjectForKeyedSubscript(key coreservices.Key) objectivec.IObject
- type GCPhysicalInputElementCollectionClass
- type GCPhysicalInputElementName
- type GCPhysicalInputElementNameObject
- type GCPhysicalInputElementObject
- type GCPhysicalInputExtents
- type GCPhysicalInputExtentsObject
- type GCPhysicalInputProfile
- func (g GCPhysicalInputProfile) AllAxes() foundation.INSSet
- func (g GCPhysicalInputProfile) AllButtons() foundation.INSSet
- func (g GCPhysicalInputProfile) AllDpads() foundation.INSSet
- func (g GCPhysicalInputProfile) AllElements() foundation.INSSet
- func (g GCPhysicalInputProfile) AllTouchpads() foundation.INSSet
- func (g GCPhysicalInputProfile) Autorelease() GCPhysicalInputProfile
- func (g GCPhysicalInputProfile) Axes() foundation.INSDictionary
- func (g GCPhysicalInputProfile) Buttons() foundation.INSDictionary
- func (g GCPhysicalInputProfile) Capture() IGCPhysicalInputProfile
- func (g GCPhysicalInputProfile) Device() GCDevice
- func (g GCPhysicalInputProfile) Dpads() foundation.INSDictionary
- func (g GCPhysicalInputProfile) Elements() foundation.INSDictionary
- func (g GCPhysicalInputProfile) ExtendedGamepad() IGCExtendedGamepad
- func (g GCPhysicalInputProfile) GCControllerUserCustomizationsDidChange() foundation.NSString
- func (g GCPhysicalInputProfile) Gamepad() unsafe.Pointer
- func (g GCPhysicalInputProfile) HasRemappedElements() bool
- func (g GCPhysicalInputProfile) Init() GCPhysicalInputProfile
- func (g GCPhysicalInputProfile) LastEventTimestamp() float64
- func (g GCPhysicalInputProfile) MappedElementAliasForPhysicalInputName(inputName string) string
- func (g GCPhysicalInputProfile) MappedPhysicalInputNamesForElementAlias(elementAlias string) foundation.INSSet
- func (g GCPhysicalInputProfile) MicroGamepad() IGCMicroGamepad
- func (g GCPhysicalInputProfile) Motion() IGCMotion
- func (g GCPhysicalInputProfile) ObjectForKeyedSubscript(key string) IGCControllerElement
- func (g GCPhysicalInputProfile) PhysicalInputProfile() IGCPhysicalInputProfile
- func (g GCPhysicalInputProfile) SetExtendedGamepad(value IGCExtendedGamepad)
- func (g GCPhysicalInputProfile) SetGamepad(value unsafe.Pointer)
- func (g GCPhysicalInputProfile) SetMicroGamepad(value IGCMicroGamepad)
- func (g GCPhysicalInputProfile) SetMotion(value IGCMotion)
- func (g GCPhysicalInputProfile) SetPhysicalInputProfile(value IGCPhysicalInputProfile)
- func (g GCPhysicalInputProfile) SetStateFromPhysicalInput(physicalInput IGCPhysicalInputProfile)
- func (g GCPhysicalInputProfile) SetValueDidChangeHandler(value GCPhysicalInputProfileGCControllerElementHandler)
- func (g GCPhysicalInputProfile) Touchpads() foundation.INSDictionary
- func (g GCPhysicalInputProfile) ValueDidChangeHandler() GCPhysicalInputProfileGCControllerElementHandler
- type GCPhysicalInputProfileClass
- type GCPhysicalInputProfileGCControllerElementHandler
- type GCPhysicalInputSource
- type GCPhysicalInputSourceDirection
- type GCPhysicalInputSourceObject
- func (o GCPhysicalInputSourceObject) BaseObject() objectivec.Object
- func (o GCPhysicalInputSourceObject) Direction() GCPhysicalInputSourceDirection
- func (o GCPhysicalInputSourceObject) ElementAliases() foundation.INSSet
- func (o GCPhysicalInputSourceObject) ElementLocalizedName() string
- func (o GCPhysicalInputSourceObject) SfSymbolsName() string
- type GCPoint2
- type GCPressedStateInput
- type GCPressedStateInputObject
- func (o GCPressedStateInputObject) BaseObject() objectivec.Object
- func (o GCPressedStateInputObject) IsPressed() bool
- func (o GCPressedStateInputObject) LastPressedStateLatency() float64
- func (o GCPressedStateInputObject) LastPressedStateTimestamp() float64
- func (o GCPressedStateInputObject) PressedDidChangeHandler() func(objc.ID, bool)
- func (o GCPressedStateInputObject) Sources() foundation.INSSet
- type GCQuaternion
- type GCRacingWheel
- func (g GCRacingWheel) AcquireDeviceWithError() (bool, error)
- func (g GCRacingWheel) Acquired() bool
- func (g GCRacingWheel) Autorelease() GCRacingWheel
- func (g GCRacingWheel) Capture() IGCRacingWheel
- func (g GCRacingWheel) GCRacingWheelDidConnect() foundation.NSString
- func (g GCRacingWheel) GCRacingWheelDidDisconnect() foundation.NSString
- func (g GCRacingWheel) HandlerQueue() dispatch.Queue
- func (g GCRacingWheel) Init() GCRacingWheel
- func (g GCRacingWheel) PhysicalInputProfile() IGCPhysicalInputProfile
- func (g GCRacingWheel) ProductCategory() string
- func (g GCRacingWheel) RelinquishDevice()
- func (g GCRacingWheel) SetHandlerQueue(value dispatch.Queue)
- func (g GCRacingWheel) Snapshot() bool
- func (g GCRacingWheel) VendorName() string
- func (g GCRacingWheel) WheelInput() IGCRacingWheelInput
- type GCRacingWheelClass
- type GCRacingWheelInput
- func (g GCRacingWheelInput) Autorelease() GCRacingWheelInput
- func (g GCRacingWheelInput) Capture() IGCRacingWheelInputState
- func (g GCRacingWheelInput) ElementValueDidChangeHandler() VoidHandler
- func (g GCRacingWheelInput) Init() GCRacingWheelInput
- func (g GCRacingWheelInput) InputStateAvailableHandler() GCDevicePhysicalInputHandler
- func (g GCRacingWheelInput) InputStateQueueDepth() int
- func (g GCRacingWheelInput) NextInputState() IGCRacingWheelInputState
- func (g GCRacingWheelInput) Queue() dispatch.Queue
- func (g GCRacingWheelInput) SetElementValueDidChangeHandler(value VoidHandler)
- func (g GCRacingWheelInput) SetInputStateAvailableHandler(value GCDevicePhysicalInputHandler)
- func (g GCRacingWheelInput) SetInputStateQueueDepth(value int)
- func (g GCRacingWheelInput) SetQueue(value dispatch.Queue)
- type GCRacingWheelInputClass
- type GCRacingWheelInputState
- func (g GCRacingWheelInputState) AcceleratorPedal() GCButtonElement
- func (g GCRacingWheelInputState) Autorelease() GCRacingWheelInputState
- func (g GCRacingWheelInputState) BrakePedal() GCButtonElement
- func (g GCRacingWheelInputState) ClutchPedal() GCButtonElement
- func (g GCRacingWheelInputState) Device() GCDevice
- func (g GCRacingWheelInputState) GCInputPedalAccelerator() string
- func (g GCRacingWheelInputState) GCInputPedalBrake() string
- func (g GCRacingWheelInputState) GCInputPedalClutch() string
- func (g GCRacingWheelInputState) GCInputShifter() string
- func (g GCRacingWheelInputState) GCInputSteeringWheel() string
- func (g GCRacingWheelInputState) Init() GCRacingWheelInputState
- func (g GCRacingWheelInputState) LastEventLatency() float64
- func (g GCRacingWheelInputState) LastEventTimestamp() float64
- func (g GCRacingWheelInputState) ObjectForKeyedSubscript(key string) GCPhysicalInputElement
- func (g GCRacingWheelInputState) SetGCInputPedalAccelerator(value string)
- func (g GCRacingWheelInputState) SetGCInputPedalBrake(value string)
- func (g GCRacingWheelInputState) SetGCInputPedalClutch(value string)
- func (g GCRacingWheelInputState) SetGCInputShifter(value string)
- func (g GCRacingWheelInputState) SetGCInputSteeringWheel(value string)
- func (g GCRacingWheelInputState) Shifter() IGCGearShifterElement
- func (g GCRacingWheelInputState) Wheel() IGCSteeringWheelElement
- type GCRacingWheelInputStateClass
- type GCRelativeInput
- type GCRelativeInputObject
- func (o GCRelativeInputObject) BaseObject() objectivec.Object
- func (o GCRelativeInputObject) Delta() float32
- func (o GCRelativeInputObject) DeltaDidChangeHandler() func(objc.ID, float32)
- func (o GCRelativeInputObject) IsAnalog() bool
- func (o GCRelativeInputObject) LastDeltaLatency() float64
- func (o GCRelativeInputObject) LastDeltaTimestamp() float64
- func (o GCRelativeInputObject) Sources() foundation.INSSet
- type GCRotationRate
- type GCSteeringWheelElement
- func (g GCSteeringWheelElement) AbsoluteInput() GCAxisInput
- func (g GCSteeringWheelElement) Aliases() foundation.INSSet
- func (g GCSteeringWheelElement) Autorelease() GCSteeringWheelElement
- func (g GCSteeringWheelElement) Init() GCSteeringWheelElement
- func (g GCSteeringWheelElement) LocalizedName() string
- func (g GCSteeringWheelElement) MaximumDegreesOfRotation() float32
- func (g GCSteeringWheelElement) RelativeInput() GCRelativeInput
- func (g GCSteeringWheelElement) SfSymbolsName() string
- type GCSteeringWheelElementClass
- type GCSwitchElement
- type GCSwitchElementName
- type GCSwitchElementNameObject
- type GCSwitchElementObject
- type GCSwitchPositionInput
- type GCSwitchPositionInputObject
- func (o GCSwitchPositionInputObject) BaseObject() objectivec.Object
- func (o GCSwitchPositionInputObject) CanWrap() bool
- func (o GCSwitchPositionInputObject) IsSequential() bool
- func (o GCSwitchPositionInputObject) LastPositionLatency() float64
- func (o GCSwitchPositionInputObject) LastPositionTimestamp() float64
- func (o GCSwitchPositionInputObject) Position() int
- func (o GCSwitchPositionInputObject) PositionDidChangeHandler() func(objc.ID, int64)
- func (o GCSwitchPositionInputObject) PositionRange() foundation.NSRange
- func (o GCSwitchPositionInputObject) Sources() foundation.INSSet
- type GCSystemGestureState
- type GCTouchState
- type GCTouchedStateInput
- type GCTouchedStateInputObject
- func (o GCTouchedStateInputObject) BaseObject() objectivec.Object
- func (o GCTouchedStateInputObject) IsTouched() bool
- func (o GCTouchedStateInputObject) LastTouchedStateLatency() float64
- func (o GCTouchedStateInputObject) LastTouchedStateTimestamp() float64
- func (o GCTouchedStateInputObject) Sources() foundation.INSSet
- func (o GCTouchedStateInputObject) TouchedDidChangeHandler() func(objc.ID, bool)
- type GCUIEventTypes
- type GCXboxGamepad
- func (g GCXboxGamepad) Autorelease() GCXboxGamepad
- func (g GCXboxGamepad) ButtonShare() IGCControllerButtonInput
- func (g GCXboxGamepad) Init() GCXboxGamepad
- func (g GCXboxGamepad) PaddleButton1() IGCControllerButtonInput
- func (g GCXboxGamepad) PaddleButton2() IGCControllerButtonInput
- func (g GCXboxGamepad) PaddleButton3() IGCControllerButtonInput
- func (g GCXboxGamepad) PaddleButton4() IGCControllerButtonInput
- type GCXboxGamepadClass
- type IGCColor
- type IGCController
- type IGCControllerAxisInput
- type IGCControllerButtonInput
- type IGCControllerDirectionPad
- type IGCControllerElement
- type IGCControllerInputState
- type IGCControllerLiveInput
- type IGCControllerTouchpad
- type IGCDeviceBattery
- type IGCDeviceCursor
- type IGCDeviceHaptics
- type IGCDeviceLight
- type IGCDirectionalGamepad
- type IGCDualSenseAdaptiveTrigger
- type IGCDualSenseGamepad
- type IGCDualShockGamepad
- type IGCEventViewController
- type IGCExtendedGamepad
- type IGCGearShifterElement
- type IGCKeyboard
- type IGCKeyboardInput
- type IGCMicroGamepad
- type IGCMotion
- type IGCMouse
- type IGCMouseInput
- type IGCPhysicalInputElementCollection
- type IGCPhysicalInputProfile
- type IGCRacingWheel
- type IGCRacingWheelInput
- type IGCRacingWheelInputState
- type IGCSteeringWheelElement
- type IGCXboxGamepad
- type VoidHandler
Constants ¶
This section is empty.
Variables ¶
var ( // GCControllerDidBecomeCurrentNotification is a notification that posts when a controller becomes the current controller. // // See: https://developer.apple.com/documentation/GameController/GCControllerDidBecomeCurrentNotification GCControllerDidBecomeCurrentNotification string // GCControllerDidConnectNotification is a notification that posts after a controller connects to the device. // // See: https://developer.apple.com/documentation/GameController/GCControllerDidConnectNotification GCControllerDidConnectNotification string // GCControllerDidDisconnectNotification is a notification that posts after a controller disconnects from the device. // // See: https://developer.apple.com/documentation/GameController/GCControllerDidDisconnectNotification GCControllerDidDisconnectNotification string // GCControllerDidStopBeingCurrentNotification is a notification that posts when a controller stops being the current controller. // // See: https://developer.apple.com/documentation/GameController/GCControllerDidStopBeingCurrentNotification GCControllerDidStopBeingCurrentNotification string // GCControllerUserCustomizationsDidChangeNotification is a notification that posts when the user customizes the button mappings or other settings of a controller. // // See: https://developer.apple.com/documentation/GameController/GCControllerUserCustomizationsDidChangeNotification GCControllerUserCustomizationsDidChangeNotification string // GCInputDirectionalCardinalDpad is the name of the controller’s optional secondary directional pad element. // // See: https://developer.apple.com/documentation/GameController/GCInputDirectionalCardinalDpad GCInputDirectionalCardinalDpad string // GCInputDirectionalCenterButton is the name of the controller’s optional button on the directional gamepad. // // See: https://developer.apple.com/documentation/GameController/GCInputDirectionalCenterButton GCInputDirectionalCenterButton string // GCInputDirectionalDpad is the name of the controller’s primary directional pad element. // // See: https://developer.apple.com/documentation/GameController/GCInputDirectionalDpad GCInputDirectionalDpad string // GCInputDirectionalTouchSurfaceButton is the name of the controller’s touch surface button. // // See: https://developer.apple.com/documentation/GameController/GCInputDirectionalTouchSurfaceButton GCInputDirectionalTouchSurfaceButton string // GCInputMicroGamepadButtonA is the name of the micro gamepad’s primary button. // // See: https://developer.apple.com/documentation/GameController/GCInputMicroGamepadButtonA GCInputMicroGamepadButtonA string // GCInputMicroGamepadButtonMenu is the name of the micro gamepad’s menu button. // // See: https://developer.apple.com/documentation/GameController/GCInputMicroGamepadButtonMenu GCInputMicroGamepadButtonMenu string // GCInputMicroGamepadButtonX is the name of the micro gamepad’s secondary button. // // See: https://developer.apple.com/documentation/GameController/GCInputMicroGamepadButtonX GCInputMicroGamepadButtonX string // GCInputMicroGamepadDpad is the name of the micro gamepad’s primary directional pad. // // See: https://developer.apple.com/documentation/GameController/GCInputMicroGamepadDpad GCInputMicroGamepadDpad string // GCKeyA is the keyboard code for the a or A character. // // See: https://developer.apple.com/documentation/GameController/GCKeyA GCKeyA string // GCKeyApplication is the keyboard code for the Application key. // // See: https://developer.apple.com/documentation/GameController/GCKeyApplication GCKeyApplication string // GCKeyB is the keyboard code for the b or B character. // // See: https://developer.apple.com/documentation/GameController/GCKeyB GCKeyB string // GCKeyBackslash is the keyboard code for the \ or | key. // // See: https://developer.apple.com/documentation/GameController/GCKeyBackslash GCKeyBackslash string // GCKeyC is the keyboard code for the c or C character. // // See: https://developer.apple.com/documentation/GameController/GCKeyC GCKeyC string // GCKeyCapsLock is the keyboard code for the Caps Lock key. // // See: https://developer.apple.com/documentation/GameController/GCKeyCapsLock GCKeyCapsLock string // GCKeyCloseBracket is the keyboard code for the ] or } key. // // See: https://developer.apple.com/documentation/GameController/GCKeyCloseBracket GCKeyCloseBracket string // GCKeyComma is the keyboard code for the Comma or < key. // // See: https://developer.apple.com/documentation/GameController/GCKeyComma GCKeyComma string // GCKeyD is the keyboard code for the d or D character. // // See: https://developer.apple.com/documentation/GameController/GCKeyD GCKeyD string // GCKeyDeleteForward is the keyboard code for the Delete-Forward key. // // See: https://developer.apple.com/documentation/GameController/GCKeyDeleteForward GCKeyDeleteForward string // GCKeyDeleteOrBackspace is the keyboard code for the Delete or Backspace key. // // See: https://developer.apple.com/documentation/GameController/GCKeyDeleteOrBackspace GCKeyDeleteOrBackspace string // GCKeyDownArrow is the keyboard code for the Down Arrow key. // // See: https://developer.apple.com/documentation/GameController/GCKeyDownArrow GCKeyDownArrow string // GCKeyE is the keyboard code for the e or E character. // // See: https://developer.apple.com/documentation/GameController/GCKeyE GCKeyE string // GCKeyEight is the keyboard code for the 8 or * character. // // See: https://developer.apple.com/documentation/GameController/GCKeyEight GCKeyEight string // GCKeyEnd is the keyboard code for the End key. // // See: https://developer.apple.com/documentation/GameController/GCKeyEnd GCKeyEnd string // GCKeyEqualSign is the keyboard code for the = or + key. // // See: https://developer.apple.com/documentation/GameController/GCKeyEqualSign GCKeyEqualSign string // GCKeyEscape is the keyboard code for the Escape key. // // See: https://developer.apple.com/documentation/GameController/GCKeyEscape GCKeyEscape string // GCKeyF is the keyboard code for the f or F character. // // See: https://developer.apple.com/documentation/GameController/GCKeyF GCKeyF string // GCKeyF1 is the keyboard code for the F1 key. // // See: https://developer.apple.com/documentation/GameController/GCKeyF1 GCKeyF1 string // GCKeyF10 is the keyboard code for the F10 key. // // See: https://developer.apple.com/documentation/GameController/GCKeyF10 GCKeyF10 string // GCKeyF11 is the keyboard code for the F11 key. // // See: https://developer.apple.com/documentation/GameController/GCKeyF11 GCKeyF11 string // GCKeyF12 is the keyboard code for the F12 key. // // See: https://developer.apple.com/documentation/GameController/GCKeyF12 GCKeyF12 string // GCKeyF13 is the keyboard code for the F13 key. // // See: https://developer.apple.com/documentation/GameController/GCKeyF13 GCKeyF13 string // GCKeyF14 is the keyboard code for the F14 key. // // See: https://developer.apple.com/documentation/GameController/GCKeyF14 GCKeyF14 string // GCKeyF15 is the keyboard code for the F15 key. // // See: https://developer.apple.com/documentation/GameController/GCKeyF15 GCKeyF15 string // GCKeyF16 is the keyboard code for the F16 key. // // See: https://developer.apple.com/documentation/GameController/GCKeyF16 GCKeyF16 string // GCKeyF17 is the keyboard code for the F17 key. // // See: https://developer.apple.com/documentation/GameController/GCKeyF17 GCKeyF17 string // GCKeyF18 is the keyboard code for the F18 key. // // See: https://developer.apple.com/documentation/GameController/GCKeyF18 GCKeyF18 string // GCKeyF19 is the keyboard code for the F19 key. // // See: https://developer.apple.com/documentation/GameController/GCKeyF19 GCKeyF19 string // GCKeyF2 is the keyboard code for the F2 key. // // See: https://developer.apple.com/documentation/GameController/GCKeyF2 GCKeyF2 string // GCKeyF20 is the keyboard code for the F20 key. // // See: https://developer.apple.com/documentation/GameController/GCKeyF20 GCKeyF20 string // GCKeyF3 is the keyboard code for the F3 key. // // See: https://developer.apple.com/documentation/GameController/GCKeyF3 GCKeyF3 string // GCKeyF4 is the keyboard code for the F4 key. // // See: https://developer.apple.com/documentation/GameController/GCKeyF4 GCKeyF4 string // GCKeyF5 is the keyboard code for the F5 key. // // See: https://developer.apple.com/documentation/GameController/GCKeyF5 GCKeyF5 string // GCKeyF6 is the keyboard code for the F6 key. // // See: https://developer.apple.com/documentation/GameController/GCKeyF6 GCKeyF6 string // GCKeyF7 is the keyboard code for the F7 key. // // See: https://developer.apple.com/documentation/GameController/GCKeyF7 GCKeyF7 string // GCKeyF8 is the keyboard code for the F8 key. // // See: https://developer.apple.com/documentation/GameController/GCKeyF8 GCKeyF8 string // GCKeyF9 is the keyboard code for the F9 key. // // See: https://developer.apple.com/documentation/GameController/GCKeyF9 GCKeyF9 string // GCKeyFive is the keyboard code for the 5 or % character. // // See: https://developer.apple.com/documentation/GameController/GCKeyFive GCKeyFive string // GCKeyFour is the keyboard code for the 4 or $ character. // // See: https://developer.apple.com/documentation/GameController/GCKeyFour GCKeyFour string // GCKeyG is the keyboard code for the g or G character. // // See: https://developer.apple.com/documentation/GameController/GCKeyG GCKeyG string // GCKeyGraveAccentAndTilde is the keyboard code for the Grave Accent or Tilde key. // // See: https://developer.apple.com/documentation/GameController/GCKeyGraveAccentAndTilde GCKeyGraveAccentAndTilde string // GCKeyH is the keyboard code for the h or H character. // // See: https://developer.apple.com/documentation/GameController/GCKeyH GCKeyH string // GCKeyHome is the keyboard code for the Home key. // // See: https://developer.apple.com/documentation/GameController/GCKeyHome GCKeyHome string // GCKeyHyphen is the keyboard code for the - or _ key. // // See: https://developer.apple.com/documentation/GameController/GCKeyHyphen GCKeyHyphen string // GCKeyI is the keyboard code for the i or I character. // // See: https://developer.apple.com/documentation/GameController/GCKeyI GCKeyI string // GCKeyInsert is the keyboard code for the Insert key. // // See: https://developer.apple.com/documentation/GameController/GCKeyInsert GCKeyInsert string // GCKeyInternational1 is the keyboard code for the first international key. // // See: https://developer.apple.com/documentation/GameController/GCKeyInternational1 GCKeyInternational1 string // GCKeyInternational2 is the keyboard code for the second international key. // // See: https://developer.apple.com/documentation/GameController/GCKeyInternational2 GCKeyInternational2 string // GCKeyInternational3 is the keyboard code for the third international key. // // See: https://developer.apple.com/documentation/GameController/GCKeyInternational3 GCKeyInternational3 string // GCKeyInternational4 is the keyboard code for the fourth international key. // // See: https://developer.apple.com/documentation/GameController/GCKeyInternational4 GCKeyInternational4 string // GCKeyInternational5 is the keyboard code for the fifth international key. // // See: https://developer.apple.com/documentation/GameController/GCKeyInternational5 GCKeyInternational5 string // GCKeyInternational6 is the keyboard code for the sixth international key. // // See: https://developer.apple.com/documentation/GameController/GCKeyInternational6 GCKeyInternational6 string // GCKeyInternational7 is the keyboard code for the seventh international key. // // See: https://developer.apple.com/documentation/GameController/GCKeyInternational7 GCKeyInternational7 string // GCKeyInternational8 is the keyboard code for the eighth international key. // // See: https://developer.apple.com/documentation/GameController/GCKeyInternational8 GCKeyInternational8 string // GCKeyInternational9 is the keyboard code for the ninth international key. // // See: https://developer.apple.com/documentation/GameController/GCKeyInternational9 GCKeyInternational9 string // GCKeyJ is the keyboard code for the j or J character. // // See: https://developer.apple.com/documentation/GameController/GCKeyJ GCKeyJ string // GCKeyK is the keyboard code for the k or K character. // // See: https://developer.apple.com/documentation/GameController/GCKeyK GCKeyK string // GCKeyKeypad0 is the keyboard code for the keypad 0 or Insert key. // // See: https://developer.apple.com/documentation/GameController/GCKeyKeypad0 GCKeyKeypad0 string // GCKeyKeypad1 is the keyboard code for the keypad 1 or End key. // // See: https://developer.apple.com/documentation/GameController/GCKeyKeypad1 GCKeyKeypad1 string // GCKeyKeypad2 is the keyboard code for the keypad 2 or Down Arrow key. // // See: https://developer.apple.com/documentation/GameController/GCKeyKeypad2 GCKeyKeypad2 string // GCKeyKeypad3 is the keyboard code for the keypad 3 or Page Down key. // // See: https://developer.apple.com/documentation/GameController/GCKeyKeypad3 GCKeyKeypad3 string // GCKeyKeypad4 is the keyboard code for the keypad 4 or Left Arrow key. // // See: https://developer.apple.com/documentation/GameController/GCKeyKeypad4 GCKeyKeypad4 string // GCKeyKeypad5 is the keyboard code for the keypad 5 key. // // See: https://developer.apple.com/documentation/GameController/GCKeyKeypad5 GCKeyKeypad5 string // GCKeyKeypad6 is the keyboard code for the keypad 6 or Right Arrow key. // // See: https://developer.apple.com/documentation/GameController/GCKeyKeypad6 GCKeyKeypad6 string // GCKeyKeypad7 is the keyboard code for the keypad 7 or Home key. // // See: https://developer.apple.com/documentation/GameController/GCKeyKeypad7 GCKeyKeypad7 string // GCKeyKeypad8 is the keyboard code for the keypad 8 or Up Arrow key. // // See: https://developer.apple.com/documentation/GameController/GCKeyKeypad8 GCKeyKeypad8 string // GCKeyKeypad9 is the keyboard code for the keypad 9 or Page Up key. // // See: https://developer.apple.com/documentation/GameController/GCKeyKeypad9 GCKeyKeypad9 string // GCKeyKeypadAsterisk is the keyboard code for the keypad * key. // // See: https://developer.apple.com/documentation/GameController/GCKeyKeypadAsterisk GCKeyKeypadAsterisk string // GCKeyKeypadEnter is the keyboard code for the keypad Enter key. // // See: https://developer.apple.com/documentation/GameController/GCKeyKeypadEnter GCKeyKeypadEnter string // GCKeyKeypadEqualSign is the keyboard code for the keypad = key. // // See: https://developer.apple.com/documentation/GameController/GCKeyKeypadEqualSign GCKeyKeypadEqualSign string // GCKeyKeypadHyphen is the keyboard code for the keypad - key. // // See: https://developer.apple.com/documentation/GameController/GCKeyKeypadHyphen GCKeyKeypadHyphen string // GCKeyKeypadNumLock is the keyboard code for the keypad Num Lock or Clear key. // // See: https://developer.apple.com/documentation/GameController/GCKeyKeypadNumLock GCKeyKeypadNumLock string // GCKeyKeypadPeriod is the keyboard code for the keypad Period or Delete key. // // See: https://developer.apple.com/documentation/GameController/GCKeyKeypadPeriod GCKeyKeypadPeriod string // GCKeyKeypadPlus is the keyboard code for the keypad + key. // // See: https://developer.apple.com/documentation/GameController/GCKeyKeypadPlus GCKeyKeypadPlus string // GCKeyKeypadSlash is the keyboard code for the keypad / key. // // See: https://developer.apple.com/documentation/GameController/GCKeyKeypadSlash GCKeyKeypadSlash string // GCKeyL is the keyboard code for the l or L character. // // See: https://developer.apple.com/documentation/GameController/GCKeyL GCKeyL string // GCKeyLANG1 is the keyboard code for the first language key. // // See: https://developer.apple.com/documentation/GameController/GCKeyLANG1 GCKeyLANG1 string // GCKeyLANG2 is the keyboard code for the second language key. // // See: https://developer.apple.com/documentation/GameController/GCKeyLANG2 GCKeyLANG2 string // GCKeyLANG3 is the keyboard code for the third language key. // // See: https://developer.apple.com/documentation/GameController/GCKeyLANG3 GCKeyLANG3 string // GCKeyLANG4 is the keyboard code for the fourth language key. // // See: https://developer.apple.com/documentation/GameController/GCKeyLANG4 GCKeyLANG4 string // GCKeyLANG5 is the keyboard code for the fifth language key. // // See: https://developer.apple.com/documentation/GameController/GCKeyLANG5 GCKeyLANG5 string // GCKeyLANG6 is the keyboard code for the sixth language key. // // See: https://developer.apple.com/documentation/GameController/GCKeyLANG6 GCKeyLANG6 string // GCKeyLANG7 is the keyboard code for the seventh language key. // // See: https://developer.apple.com/documentation/GameController/GCKeyLANG7 GCKeyLANG7 string // GCKeyLANG8 is the keyboard code for the eighth language key. // // See: https://developer.apple.com/documentation/GameController/GCKeyLANG8 GCKeyLANG8 string // GCKeyLANG9 is the keyboard code for the ninth language key. // // See: https://developer.apple.com/documentation/GameController/GCKeyLANG9 GCKeyLANG9 string // GCKeyLeftAlt is the keyboard code for the Option or Alt key on the left side of the keyboard. // // See: https://developer.apple.com/documentation/GameController/GCKeyLeftAlt GCKeyLeftAlt string // GCKeyLeftArrow is the keyboard code for the Left Arrow key. // // See: https://developer.apple.com/documentation/GameController/GCKeyLeftArrow GCKeyLeftArrow string // GCKeyLeftControl is the keyboard code for the Control key on the left side of the keyboard. // // See: https://developer.apple.com/documentation/GameController/GCKeyLeftControl GCKeyLeftControl string // GCKeyLeftGUI is the keyboard code for the Command key on the left side of the keyboard. // // See: https://developer.apple.com/documentation/GameController/GCKeyLeftGUI GCKeyLeftGUI string // GCKeyLeftShift is the keyboard code for the Shift key on the left side of the keyboard. // // See: https://developer.apple.com/documentation/GameController/GCKeyLeftShift GCKeyLeftShift string // GCKeyM is the keyboard code for the m or M character. // // See: https://developer.apple.com/documentation/GameController/GCKeyM GCKeyM string // GCKeyN is the keyboard code for the n or N character. // // See: https://developer.apple.com/documentation/GameController/GCKeyN GCKeyN string // GCKeyNine is the keyboard code for the 9 or ( character. // // See: https://developer.apple.com/documentation/GameController/GCKeyNine GCKeyNine string // GCKeyNonUSBackslash is the keyboard code for the non-US Slash or | key. // // See: https://developer.apple.com/documentation/GameController/GCKeyNonUSBackslash GCKeyNonUSBackslash string // GCKeyNonUSPound is the keyboard code for the non-US Pound or _ key. // // See: https://developer.apple.com/documentation/GameController/GCKeyNonUSPound GCKeyNonUSPound string // GCKeyO is the keyboard code for the o or O character. // // See: https://developer.apple.com/documentation/GameController/GCKeyO GCKeyO string // GCKeyOne is the keyboard code for the 1 or ! character. // // See: https://developer.apple.com/documentation/GameController/GCKeyOne GCKeyOne string // GCKeyOpenBracket is the keyboard code for the [ or { key. // // See: https://developer.apple.com/documentation/GameController/GCKeyOpenBracket GCKeyOpenBracket string // GCKeyP is the keyboard code for the p or P character. // // See: https://developer.apple.com/documentation/GameController/GCKeyP GCKeyP string // GCKeyPageDown is the keyboard code for the Page Down key. // // See: https://developer.apple.com/documentation/GameController/GCKeyPageDown GCKeyPageDown string // GCKeyPageUp is the keyboard code for the Page Up key. // // See: https://developer.apple.com/documentation/GameController/GCKeyPageUp GCKeyPageUp string // GCKeyPause is the keyboard code for the Pause key. // // See: https://developer.apple.com/documentation/GameController/GCKeyPause GCKeyPause string // GCKeyPeriod is the keyboard code for the Period or > key. // // See: https://developer.apple.com/documentation/GameController/GCKeyPeriod GCKeyPeriod string // GCKeyPower is the keyboard code for the Power key. // // See: https://developer.apple.com/documentation/GameController/GCKeyPower GCKeyPower string // GCKeyPrintScreen is the keyboard code for the Print Screen key. // // See: https://developer.apple.com/documentation/GameController/GCKeyPrintScreen GCKeyPrintScreen string // GCKeyQ is the keyboard code for the q or Q character. // // See: https://developer.apple.com/documentation/GameController/GCKeyQ GCKeyQ string // GCKeyQuote is the keyboard code for the ’ or “ key. // // See: https://developer.apple.com/documentation/GameController/GCKeyQuote GCKeyQuote string // GCKeyR is the keyboard code for the r or R character. // // See: https://developer.apple.com/documentation/GameController/GCKeyR GCKeyR string // GCKeyReturnOrEnter is the keyboard code for the Return or Enter key. // // See: https://developer.apple.com/documentation/GameController/GCKeyReturnOrEnter GCKeyReturnOrEnter string // GCKeyRightAlt is the keyboard code for the Option or Alt key on the right side of the keyboard. // // See: https://developer.apple.com/documentation/GameController/GCKeyRightAlt GCKeyRightAlt string // GCKeyRightArrow is the keyboard code for the Right Arrow key. // // See: https://developer.apple.com/documentation/GameController/GCKeyRightArrow GCKeyRightArrow string // GCKeyRightControl is the keyboard code for the Control key on the right side of the keyboard. // // See: https://developer.apple.com/documentation/GameController/GCKeyRightControl GCKeyRightControl string // GCKeyRightGUI is the keyboard code for the Command key on the right side of the keyboard. // // See: https://developer.apple.com/documentation/GameController/GCKeyRightGUI GCKeyRightGUI string // GCKeyRightShift is the keyboard code for the Shift key on the right side of the keyboard. // // See: https://developer.apple.com/documentation/GameController/GCKeyRightShift GCKeyRightShift string // GCKeyS is the keyboard code for the s or S character. // // See: https://developer.apple.com/documentation/GameController/GCKeyS GCKeyS string // GCKeyScrollLock is the keyboard code for the Scroll Lock key. // // See: https://developer.apple.com/documentation/GameController/GCKeyScrollLock GCKeyScrollLock string // GCKeySemicolon is the keyboard code for the ; or : key. // // See: https://developer.apple.com/documentation/GameController/GCKeySemicolon GCKeySemicolon string // GCKeySeven is the keyboard code for the 7 or & character. // // See: https://developer.apple.com/documentation/GameController/GCKeySeven GCKeySeven string // GCKeySix is the keyboard code for the 6 or ^ character. // // See: https://developer.apple.com/documentation/GameController/GCKeySix GCKeySix string // GCKeySlash is the keyboard code for the / or ? key. // // See: https://developer.apple.com/documentation/GameController/GCKeySlash GCKeySlash string // GCKeySpacebar is the keyboard code for the Space Bar key. // // See: https://developer.apple.com/documentation/GameController/GCKeySpacebar GCKeySpacebar string // GCKeyT is the keyboard code for the t or T character. // // See: https://developer.apple.com/documentation/GameController/GCKeyT GCKeyT string // GCKeyTab is the keyboard code for the Tab key. // // See: https://developer.apple.com/documentation/GameController/GCKeyTab GCKeyTab string // GCKeyThree is the keyboard code for the 3 or # character. // // See: https://developer.apple.com/documentation/GameController/GCKeyThree GCKeyThree string // GCKeyTwo is the keyboard code for the 2 or @ character. // // See: https://developer.apple.com/documentation/GameController/GCKeyTwo GCKeyTwo string // GCKeyU is the keyboard code for the u or U character. // // See: https://developer.apple.com/documentation/GameController/GCKeyU GCKeyU string // GCKeyUpArrow is the keyboard code for the Up Arrow key. // // See: https://developer.apple.com/documentation/GameController/GCKeyUpArrow GCKeyUpArrow string // GCKeyV is the keyboard code for the v or V character. // // See: https://developer.apple.com/documentation/GameController/GCKeyV GCKeyV string // GCKeyW is the keyboard code for the w or W character. // // See: https://developer.apple.com/documentation/GameController/GCKeyW GCKeyW string // GCKeyX is the keyboard code for the x or X character. // // See: https://developer.apple.com/documentation/GameController/GCKeyX GCKeyX string // GCKeyY is the keyboard code for the y or Y character. // // See: https://developer.apple.com/documentation/GameController/GCKeyY GCKeyY string // GCKeyZ is the keyboard code for the z or Z character. // // See: https://developer.apple.com/documentation/GameController/GCKeyZ GCKeyZ string // GCKeyZero is the keyboard code for the 0 or ) character. // // See: https://developer.apple.com/documentation/GameController/GCKeyZero GCKeyZero string // GCKeyboardDidConnectNotification is a notification that posts after a keyboard connects to the device. // // See: https://developer.apple.com/documentation/GameController/GCKeyboardDidConnectNotification GCKeyboardDidConnectNotification string // GCKeyboardDidDisconnectNotification is a notification that posts after a single keyboard, or the last of multiple keyboards, disconnects from the device. // // See: https://developer.apple.com/documentation/GameController/GCKeyboardDidDisconnectNotification GCKeyboardDidDisconnectNotification string // GCMouseDidBecomeCurrentNotification is a notification that posts when a mouse becomes the most recent mouse that the user connects. // // See: https://developer.apple.com/documentation/GameController/GCMouseDidBecomeCurrentNotification GCMouseDidBecomeCurrentNotification string // GCMouseDidConnectNotification is a notification that posts after a mouse connects to the device. // // See: https://developer.apple.com/documentation/GameController/GCMouseDidConnectNotification GCMouseDidConnectNotification string // GCMouseDidDisconnectNotification is a notification that posts after a mouse disconnects from the device. // // See: https://developer.apple.com/documentation/GameController/GCMouseDidDisconnectNotification GCMouseDidDisconnectNotification string // GCMouseDidStopBeingCurrentNotification is a notification that posts when a mouse stops being the most recent mouse that the user connects. // // See: https://developer.apple.com/documentation/GameController/GCMouseDidStopBeingCurrentNotification GCMouseDidStopBeingCurrentNotification string // GCProductCategoryArcadeStick is the arcade stick product category. // // See: https://developer.apple.com/documentation/GameController/GCProductCategoryArcadeStick GCProductCategoryArcadeStick string // GCProductCategoryCoalescedRemote is the Apple TV Remote product category for physical and virtual remotes that Game Center combines into a single device. // // See: https://developer.apple.com/documentation/GameController/GCProductCategoryCoalescedRemote GCProductCategoryCoalescedRemote string // GCProductCategoryControlCenterRemote is the virtual remote in the Control Center on iOS and tvOS devices for controlling the Apple TV. // // See: https://developer.apple.com/documentation/GameController/GCProductCategoryControlCenterRemote GCProductCategoryControlCenterRemote string // GCProductCategoryDualSense is the DualSense product category. // // See: https://developer.apple.com/documentation/GameController/GCProductCategoryDualSense GCProductCategoryDualSense string // GCProductCategoryDualShock4 is the DualShock 4 product category. // // See: https://developer.apple.com/documentation/GameController/GCProductCategoryDualShock4 GCProductCategoryDualShock4 string // GCProductCategoryHID is the category for products that support the human interface device (HID) protocol. // // See: https://developer.apple.com/documentation/GameController/GCProductCategoryHID GCProductCategoryHID string // GCProductCategoryKeyboard is the keyboard product category. // // See: https://developer.apple.com/documentation/GameController/GCProductCategoryKeyboard GCProductCategoryKeyboard string // GCProductCategoryMFi is the MFi product category. // // See: https://developer.apple.com/documentation/GameController/GCProductCategoryMFi GCProductCategoryMFi string // GCProductCategoryMouse is the mouse product category. // // See: https://developer.apple.com/documentation/GameController/GCProductCategoryMouse GCProductCategoryMouse string // GCProductCategorySiriRemote1stGen is the first-generation Siri Remote or first-generation Apple TV Remote product category. // // See: https://developer.apple.com/documentation/GameController/GCProductCategorySiriRemote1stGen GCProductCategorySiriRemote1stGen string // GCProductCategorySiriRemote2ndGen is the second-generation Siri Remote or second-generation Apple TV Remote product category. // // See: https://developer.apple.com/documentation/GameController/GCProductCategorySiriRemote2ndGen GCProductCategorySiriRemote2ndGen string // GCProductCategorySpatialController is the category for game controller products that support 6DoF tracking on visionOS. // // See: https://developer.apple.com/documentation/GameController/GCProductCategorySpatialController GCProductCategorySpatialController string // GCProductCategoryUniversalElectronicsRemote is the product category for a Universal Electronics remote that works with Apple TV. // // See: https://developer.apple.com/documentation/GameController/GCProductCategoryUniversalElectronicsRemote GCProductCategoryUniversalElectronicsRemote string // GCProductCategoryXboxOne is the Xbox product category. // // See: https://developer.apple.com/documentation/GameController/GCProductCategoryXboxOne GCProductCategoryXboxOne string // GCRacingWheelDidConnectNotification is a notification that posts after a racing wheel controller connects to the device. // // See: https://developer.apple.com/documentation/GameController/GCRacingWheelDidConnectNotification GCRacingWheelDidConnectNotification string // GCRacingWheelDidDisconnectNotification is a notification that posts after a racing wheel controller disconnects from the device. // // See: https://developer.apple.com/documentation/GameController/GCRacingWheelDidDisconnectNotification GCRacingWheelDidDisconnectNotification string )
var ( // GCHapticDurationInfinite is an infinite duration for a haptics event. // // See: https://developer.apple.com/documentation/GameController/GCHapticDurationInfinite GCHapticDurationInfinite float32 )
var GCHapticsLocalitys struct { // All: All locations of haptics actuators on a game controller. All GCHapticsLocality // Default: The default location of a haptics actuator on a game controller. Default GCHapticsLocality // Handles: All handles on a game controller. Handles GCHapticsLocality // LeftHandle: The left handle on a game controller. LeftHandle GCHapticsLocality // LeftTrigger: The left trigger on a game controller. LeftTrigger GCHapticsLocality // RightHandle: The right handle on a game controller. RightHandle GCHapticsLocality // RightTrigger: The right trigger on a game controller. RightTrigger GCHapticsLocality // Triggers: All triggers on a game controller. Triggers GCHapticsLocality }
GCHapticsLocalitys provides typed accessors for GCHapticsLocality constants.
var GCKeyCodes struct { // Application: The keyboard code for the Application key. Application GCKeyCode // Backslash: The keyboard code for the \ or | key. Backslash GCKeyCode // CapsLock: The keyboard code for the Caps Lock key. CapsLock GCKeyCode // CloseBracket: The keyboard code for the ] or } key. CloseBracket GCKeyCode // Comma: The keyboard code for the Comma or < key. Comma GCKeyCode // DeleteForward: The keyboard code for the Delete-Forward key. DeleteForward GCKeyCode // DeleteOrBackspace: The keyboard code for the Delete or Backspace key. DeleteOrBackspace GCKeyCode // DownArrow: The keyboard code for the Down Arrow key. DownArrow GCKeyCode // Eight: The keyboard code for the 8 or * character. Eight GCKeyCode // End: The keyboard code for the End key. End GCKeyCode // EqualSign: The keyboard code for the = or + key. EqualSign GCKeyCode // Escape: The keyboard code for the Escape key. Escape GCKeyCode // F1: The keyboard code for the F1 key. F1 GCKeyCode // F10: The keyboard code for the F10 key. F10 GCKeyCode // F11: The keyboard code for the F11 key. F11 GCKeyCode // F12: The keyboard code for the F12 key. F12 GCKeyCode // F13: The keyboard code for the F13 key. F13 GCKeyCode // F14: The keyboard code for the F14 key. F14 GCKeyCode // F15: The keyboard code for the F15 key. F15 GCKeyCode // F16: The keyboard code for the F16 key. F16 GCKeyCode // F17: The keyboard code for the F17 key. F17 GCKeyCode // F18: The keyboard code for the F18 key. F18 GCKeyCode // F19: The keyboard code for the F19 key. F19 GCKeyCode // F2: The keyboard code for the F2 key. F2 GCKeyCode // F20: The keyboard code for the F20 key. F20 GCKeyCode // F3: The keyboard code for the F3 key. F3 GCKeyCode // F4: The keyboard code for the F4 key. F4 GCKeyCode // F5: The keyboard code for the F5 key. F5 GCKeyCode // F6: The keyboard code for the F6 key. F6 GCKeyCode // F7: The keyboard code for the F7 key. F7 GCKeyCode // F8: The keyboard code for the F8 key. F8 GCKeyCode // F9: The keyboard code for the F9 key. F9 GCKeyCode // Five: The keyboard code for the 5 or % character. Five GCKeyCode // Four: The keyboard code for the 4 or $ character. Four GCKeyCode // GraveAccentAndTilde: The keyboard code for the Grave Accent or Tilde key. GraveAccentAndTilde GCKeyCode // Home: The keyboard code for the Home key. Home GCKeyCode // Hyphen: The keyboard code for the - or _ key. Hyphen GCKeyCode // Insert: The keyboard code for the Insert key. Insert GCKeyCode // International1: The keyboard code for the first international key. International1 GCKeyCode // International2: The keyboard code for the second international key. International2 GCKeyCode // International3: The keyboard code for the third international key. International3 GCKeyCode // International4: The keyboard code for the fourth international key. International4 GCKeyCode // International5: The keyboard code for the fifth international key. International5 GCKeyCode // International6: The keyboard code for the sixth international key. International6 GCKeyCode // International7: The keyboard code for the seventh international key. International7 GCKeyCode // International8: The keyboard code for the eighth international key. International8 GCKeyCode // International9: The keyboard code for the ninth international key. International9 GCKeyCode // KeyA: The keyboard code for the a or A character. KeyA GCKeyCode // KeyB: The keyboard code for the b or B character. KeyB GCKeyCode // KeyC: The keyboard code for the c or C character. KeyC GCKeyCode // KeyD: The keyboard code for the d or D character. KeyD GCKeyCode // KeyE: The keyboard code for the e or E character. KeyE GCKeyCode // KeyF: The keyboard code for the f or F character. KeyF GCKeyCode // KeyG: The keyboard code for the g or G character. KeyG GCKeyCode // KeyH: The keyboard code for the h or H character. KeyH GCKeyCode // KeyI: The keyboard code for the i or I character. KeyI GCKeyCode // KeyJ: The keyboard code for the j or J character. KeyJ GCKeyCode // KeyK: The keyboard code for the k or K character. KeyK GCKeyCode // KeyL: The keyboard code for the l or L character. KeyL GCKeyCode // KeyM: The keyboard code for the m or M character. KeyM GCKeyCode // KeyN: The keyboard code for the n or N character. KeyN GCKeyCode // KeyO: The keyboard code for the o or O character. KeyO GCKeyCode // KeyP: The keyboard code for the p or P character. KeyP GCKeyCode // KeyQ: The keyboard code for the q or Q character. KeyQ GCKeyCode // KeyR: The keyboard code for the r or R character. KeyR GCKeyCode // KeyS: The keyboard code for the s or S character. KeyS GCKeyCode // KeyT: The keyboard code for the t or T character. KeyT GCKeyCode // KeyU: The keyboard code for the u or U character. KeyU GCKeyCode // KeyV: The keyboard code for the v or V character. KeyV GCKeyCode // KeyW: The keyboard code for the w or W character. KeyW GCKeyCode // KeyX: The keyboard code for the x or X character. KeyX GCKeyCode // KeyY: The keyboard code for the y or Y character. KeyY GCKeyCode // KeyZ: The keyboard code for the z or Z character. KeyZ GCKeyCode // Keypad0: The keyboard code for the keypad 0 or Insert key. Keypad0 GCKeyCode // Keypad1: The keyboard code for the keypad 1 or End key. Keypad1 GCKeyCode // Keypad2: The keyboard code for the keypad 2 or Down Arrow key. Keypad2 GCKeyCode // Keypad3: The keyboard code for the keypad 3 or Page Down key. Keypad3 GCKeyCode // Keypad4: The keyboard code for the keypad 4 or Left Arrow key. Keypad4 GCKeyCode // Keypad5: The keyboard code for the keypad 5 key. Keypad5 GCKeyCode // Keypad6: The keyboard code for the keypad 6 or Right Arrow key. Keypad6 GCKeyCode // Keypad7: The keyboard code for the keypad 7 or Home key. Keypad7 GCKeyCode // Keypad8: The keyboard code for the keypad 8 or Up Arrow key. Keypad8 GCKeyCode // Keypad9: The keyboard code for the keypad 9 or Page Up key. Keypad9 GCKeyCode // KeypadAsterisk: The keyboard code for the keypad * key. KeypadAsterisk GCKeyCode // KeypadEnter: The keyboard code for the keypad Enter key. KeypadEnter GCKeyCode // KeypadEqualSign: The keyboard code for the keypad = key. KeypadEqualSign GCKeyCode // KeypadHyphen: The keyboard code for the keypad - key. KeypadHyphen GCKeyCode // KeypadNumLock: The keyboard code for the keypad Num Lock or Clear key. KeypadNumLock GCKeyCode // KeypadPeriod: The keyboard code for the keypad Period or Delete key. KeypadPeriod GCKeyCode // KeypadPlus: The keyboard code for the keypad + key. KeypadPlus GCKeyCode // KeypadSlash: The keyboard code for the keypad / key. KeypadSlash GCKeyCode // LANG1: The keyboard code for the first language key. LANG1 GCKeyCode // LANG2: The keyboard code for the second language key. LANG2 GCKeyCode // LANG3: The keyboard code for the third language key. LANG3 GCKeyCode // LANG4: The keyboard code for the fourth language key. LANG4 GCKeyCode // LANG5: The keyboard code for the fifth language key. LANG5 GCKeyCode // LANG6: The keyboard code for the sixth language key. LANG6 GCKeyCode // LANG7: The keyboard code for the seventh language key. LANG7 GCKeyCode // LANG8: The keyboard code for the eighth language key. LANG8 GCKeyCode // LANG9: The keyboard code for the ninth language key. LANG9 GCKeyCode // LeftAlt: The keyboard code for the Option or Alt key on the left side of the keyboard. LeftAlt GCKeyCode // LeftArrow: The keyboard code for the Left Arrow key. LeftArrow GCKeyCode // LeftControl: The keyboard code for the Control key on the left side of the keyboard. LeftControl GCKeyCode // LeftGUI: The keyboard code for the Command key on the left side of the keyboard. LeftGUI GCKeyCode // LeftShift: The keyboard code for the Shift key on the left side of the keyboard. LeftShift GCKeyCode // Nine: The keyboard code for the 9 or ( character. Nine GCKeyCode // NonUSBackslash: The keyboard code for the non-US Slash or | key. NonUSBackslash GCKeyCode // NonUSPound: The keyboard code for the non-US Pound or _ key. NonUSPound GCKeyCode // One: The keyboard code for the 1 or ! character. One GCKeyCode // OpenBracket: The keyboard code for the [ or { key. OpenBracket GCKeyCode // PageDown: The keyboard code for the Page Down key. PageDown GCKeyCode // PageUp: The keyboard code for the Page Up key. PageUp GCKeyCode // Pause: The keyboard code for the Pause key. Pause GCKeyCode // Period: The keyboard code for the Period or > key. Period GCKeyCode // Power: The keyboard code for the Power key. Power GCKeyCode // PrintScreen: The keyboard code for the Print Screen key. PrintScreen GCKeyCode // Quote: The keyboard code for the ’ or “ key. Quote GCKeyCode // ReturnOrEnter: The keyboard code for the Return or Enter key. ReturnOrEnter GCKeyCode // RightAlt: The keyboard code for the Option or Alt key on the right side of the keyboard. RightAlt GCKeyCode // RightArrow: The keyboard code for the Right Arrow key. RightArrow GCKeyCode // RightControl: The keyboard code for the Control key on the right side of the keyboard. RightControl GCKeyCode // RightGUI: The keyboard code for the Command key on the right side of the keyboard. RightGUI GCKeyCode // RightShift: The keyboard code for the Shift key on the right side of the keyboard. RightShift GCKeyCode // ScrollLock: The keyboard code for the Scroll Lock key. ScrollLock GCKeyCode // Semicolon: The keyboard code for the ; or : key. Semicolon GCKeyCode // Seven: The keyboard code for the 7 or & character. Seven GCKeyCode // Six: The keyboard code for the 6 or ^ character. Six GCKeyCode // Slash: The keyboard code for the / or ? key. Slash GCKeyCode // Spacebar: The keyboard code for the Space Bar key. Spacebar GCKeyCode // Tab: The keyboard code for the Tab key. Tab GCKeyCode // Three: The keyboard code for the 3 or # character. Three GCKeyCode // Two: The keyboard code for the 2 or @ character. Two GCKeyCode // UpArrow: The keyboard code for the Up Arrow key. UpArrow GCKeyCode // Zero: The keyboard code for the 0 or ) character. Zero GCKeyCode }
GCKeyCodes provides typed accessors for GCKeyCode constants.
Functions ¶
func NSStringFromGCPoint2 ¶
func NSStringFromGCPoint2(point GCPoint2) foundation.NSString
NSStringFromGCPoint2 returns a string representation of a point.
See: https://developer.apple.com/documentation/GameController/NSStringFromGCPoint2(_:)
func NewGCDevicePhysicalInputBlock ¶
func NewGCDevicePhysicalInputBlock(handler GCDevicePhysicalInputHandler) (objc.ID, func())
NewGCDevicePhysicalInputBlock wraps a Go GCDevicePhysicalInputHandler as an Objective-C block. The caller must defer the returned cleanup function.
func NewGCPhysicalInputProfileGCControllerElementBlock ¶
func NewGCPhysicalInputProfileGCControllerElementBlock(handler GCPhysicalInputProfileGCControllerElementHandler) (objc.ID, func())
NewGCPhysicalInputProfileGCControllerElementBlock wraps a Go GCPhysicalInputProfileGCControllerElementHandler as an Objective-C block. The caller must defer the returned cleanup function.
func NewVoidBlock ¶
func NewVoidBlock(handler VoidHandler) (objc.ID, func())
NewVoidBlock wraps a Go VoidHandler as an Objective-C block. The caller must defer the returned cleanup function.
Used by:
- [GCController.StartWirelessControllerDiscoveryWithCompletionHandler]
Types ¶
type GCAcceleration ¶
type GCAcceleration struct {
X float64 // The acceleration measurement along the x-axis, in multiples of earth’s gravity.
Y float64 // The acceleration measurement along the y-axis, in multiples of earth’s gravity.
Z float64 // The acceleration measurement along the z-axis, in multiples of earth’s gravity.
}
GCAcceleration - A three-dimensional acceleration vector.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/GameController/GCAcceleration
type GCAxis2DInput ¶
type GCAxis2DInput interface {
objectivec.IObject
// A Boolean value that indicates whether the value wraps when it reaches the range’s minimum or maximum value.
//
// See: https://developer.apple.com/documentation/GameController/GCAxis2DInput/canWrap
CanWrap() bool
// A Boolean value that indicates whether the input provides analog values.
//
// See: https://developer.apple.com/documentation/GameController/GCAxis2DInput/isAnalog
IsAnalog() bool
// The axis input represented as a normalized point in a two-dimensional coordinate system.
//
// See: https://developer.apple.com/documentation/GameController/GCAxis2DInput/value
Value() GCPoint2
// The block that the axis element calls when its value changes.
//
// See: https://developer.apple.com/documentation/GameController/GCAxis2DInput/valueDidChangeHandler
ValueDidChangeHandler() func(objc.ID, unsafe.Pointer)
// The time of the most recent value change.
//
// See: https://developer.apple.com/documentation/GameController/GCAxis2DInput/lastValueTimestamp
LastValueTimestamp() float64
// The time in seconds between the last value change and the current time.
//
// See: https://developer.apple.com/documentation/GameController/GCAxis2DInput/lastValueLatency
LastValueLatency() float64
// One or more physical actions the user performs to manipulate the input.
//
// See: https://developer.apple.com/documentation/GameController/GCAxis2DInput/sources
Sources() foundation.INSSet
}
The common properties of inputs that provide a normalized point in a two-dimensional coordinate system with a fixed origin.
See: https://developer.apple.com/documentation/GameController/GCAxis2DInput
type GCAxis2DInputObject ¶
type GCAxis2DInputObject struct {
objectivec.Object
}
GCAxis2DInputObject wraps an existing Objective-C object that conforms to the GCAxis2DInput protocol.
func GCAxis2DInputObjectFromID ¶
func GCAxis2DInputObjectFromID(id objc.ID) GCAxis2DInputObject
GCAxis2DInputObjectFromID constructs a GCAxis2DInputObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (GCAxis2DInputObject) BaseObject ¶
func (o GCAxis2DInputObject) BaseObject() objectivec.Object
func (GCAxis2DInputObject) CanWrap ¶
func (o GCAxis2DInputObject) CanWrap() bool
A Boolean value that indicates whether the value wraps when it reaches the range’s minimum or maximum value.
See: https://developer.apple.com/documentation/GameController/GCAxis2DInput/canWrap
func (GCAxis2DInputObject) IsAnalog ¶
func (o GCAxis2DInputObject) IsAnalog() bool
A Boolean value that indicates whether the input provides analog values.
See: https://developer.apple.com/documentation/GameController/GCAxis2DInput/isAnalog
func (GCAxis2DInputObject) LastValueLatency ¶
func (o GCAxis2DInputObject) LastValueLatency() float64
The time in seconds between the last value change and the current time.
See: https://developer.apple.com/documentation/GameController/GCAxis2DInput/lastValueLatency
func (GCAxis2DInputObject) LastValueTimestamp ¶
func (o GCAxis2DInputObject) LastValueTimestamp() float64
The time of the most recent value change.
See: https://developer.apple.com/documentation/GameController/GCAxis2DInput/lastValueTimestamp
func (GCAxis2DInputObject) Sources ¶
func (o GCAxis2DInputObject) Sources() foundation.INSSet
One or more physical actions the user performs to manipulate the input.
See: https://developer.apple.com/documentation/GameController/GCAxis2DInput/sources
func (GCAxis2DInputObject) Value ¶
func (o GCAxis2DInputObject) Value() GCPoint2
The axis input represented as a normalized point in a two-dimensional coordinate system.
See: https://developer.apple.com/documentation/GameController/GCAxis2DInput/value
func (GCAxis2DInputObject) ValueDidChangeHandler ¶
func (o GCAxis2DInputObject) ValueDidChangeHandler() func(objc.ID, unsafe.Pointer)
The block that the axis element calls when its value changes.
See: https://developer.apple.com/documentation/GameController/GCAxis2DInput/valueDidChangeHandler
type GCAxisElement ¶
type GCAxisElement interface {
objectivec.IObject
GCPhysicalInputElement
// An input object that provides absolute axis values.
//
// See: https://developer.apple.com/documentation/GameController/GCAxisElement/absoluteInput
AbsoluteInput() GCAxisInput
// An input object that provides relative axis values.
//
// See: https://developer.apple.com/documentation/GameController/GCAxisElement/relativeInput
RelativeInput() GCRelativeInput
}
The common properties for an element that represents an absolute or relative input value along an axis.
See: https://developer.apple.com/documentation/GameController/GCAxisElement
type GCAxisElementName ¶
type GCAxisElementName interface {
objectivec.IObject
GCPhysicalInputElementName
}
The names for the elements that provide values along an axis.
See: https://developer.apple.com/documentation/GameController/GCAxisElementName-c.protocol
type GCAxisElementNameObject ¶
type GCAxisElementNameObject struct {
objectivec.Object
}
GCAxisElementNameObject wraps an existing Objective-C object that conforms to the GCAxisElementName protocol.
func GCAxisElementNameObjectFromID ¶
func GCAxisElementNameObjectFromID(id objc.ID) GCAxisElementNameObject
GCAxisElementNameObjectFromID constructs a GCAxisElementNameObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (GCAxisElementNameObject) BaseObject ¶
func (o GCAxisElementNameObject) BaseObject() objectivec.Object
type GCAxisElementObject ¶
type GCAxisElementObject struct {
objectivec.Object
}
GCAxisElementObject wraps an existing Objective-C object that conforms to the GCAxisElement protocol.
func GCAxisElementObjectFromID ¶
func GCAxisElementObjectFromID(id objc.ID) GCAxisElementObject
GCAxisElementObjectFromID constructs a GCAxisElementObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (GCAxisElementObject) AbsoluteInput ¶
func (o GCAxisElementObject) AbsoluteInput() GCAxisInput
An input object that provides absolute axis values.
See: https://developer.apple.com/documentation/GameController/GCAxisElement/absoluteInput
func (GCAxisElementObject) Aliases ¶
func (o GCAxisElementObject) Aliases() foundation.INSSet
The element’s aliases to use when accessing it with the subscript notation.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElement/aliases
func (GCAxisElementObject) BaseObject ¶
func (o GCAxisElementObject) BaseObject() objectivec.Object
func (GCAxisElementObject) LocalizedName ¶
func (o GCAxisElementObject) LocalizedName() string
The localized name for the element.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElement/localizedName
func (GCAxisElementObject) RelativeInput ¶
func (o GCAxisElementObject) RelativeInput() GCRelativeInput
An input object that provides relative axis values.
See: https://developer.apple.com/documentation/GameController/GCAxisElement/relativeInput
func (GCAxisElementObject) SfSymbolsName ¶
func (o GCAxisElementObject) SfSymbolsName() string
A system symbol for the element.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElement/sfSymbolsName
type GCAxisInput ¶
type GCAxisInput interface {
objectivec.IObject
// A Boolean value that indicates whether the value wraps when it reaches the range’s minimum or maximum value.
//
// See: https://developer.apple.com/documentation/GameController/GCAxisInput/canWrap
CanWrap() bool
// A Boolean value that indicates whether the input provides analog values.
//
// See: https://developer.apple.com/documentation/GameController/GCAxisInput/isAnalog
IsAnalog() bool
// The value along the axis, in unit coordinates.
//
// See: https://developer.apple.com/documentation/GameController/GCAxisInput/value
Value() float32
// The block that the input object calls when the value changes.
//
// See: https://developer.apple.com/documentation/GameController/GCAxisInput/valueDidChangeHandler
ValueDidChangeHandler() func(objc.ID, float32)
// The time of the most recent value change.
//
// See: https://developer.apple.com/documentation/GameController/GCAxisInput/lastValueTimestamp
LastValueTimestamp() float64
// The time in seconds between the last value change and the current time.
//
// See: https://developer.apple.com/documentation/GameController/GCAxisInput/lastValueLatency
LastValueLatency() float64
// One or more physical actions the user performs to manipulate the input.
//
// See: https://developer.apple.com/documentation/GameController/GCAxisInput/sources
Sources() foundation.INSSet
}
The common properties of inputs that provide absolute values along an axis with a fixed origin.
See: https://developer.apple.com/documentation/GameController/GCAxisInput
type GCAxisInputObject ¶
type GCAxisInputObject struct {
objectivec.Object
}
GCAxisInputObject wraps an existing Objective-C object that conforms to the GCAxisInput protocol.
func GCAxisInputObjectFromID ¶
func GCAxisInputObjectFromID(id objc.ID) GCAxisInputObject
GCAxisInputObjectFromID constructs a GCAxisInputObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (GCAxisInputObject) BaseObject ¶
func (o GCAxisInputObject) BaseObject() objectivec.Object
func (GCAxisInputObject) CanWrap ¶
func (o GCAxisInputObject) CanWrap() bool
A Boolean value that indicates whether the value wraps when it reaches the range’s minimum or maximum value.
See: https://developer.apple.com/documentation/GameController/GCAxisInput/canWrap
func (GCAxisInputObject) IsAnalog ¶
func (o GCAxisInputObject) IsAnalog() bool
A Boolean value that indicates whether the input provides analog values.
See: https://developer.apple.com/documentation/GameController/GCAxisInput/isAnalog
func (GCAxisInputObject) LastValueLatency ¶
func (o GCAxisInputObject) LastValueLatency() float64
The time in seconds between the last value change and the current time.
See: https://developer.apple.com/documentation/GameController/GCAxisInput/lastValueLatency
func (GCAxisInputObject) LastValueTimestamp ¶
func (o GCAxisInputObject) LastValueTimestamp() float64
The time of the most recent value change.
See: https://developer.apple.com/documentation/GameController/GCAxisInput/lastValueTimestamp
func (GCAxisInputObject) Sources ¶
func (o GCAxisInputObject) Sources() foundation.INSSet
One or more physical actions the user performs to manipulate the input.
See: https://developer.apple.com/documentation/GameController/GCAxisInput/sources
func (GCAxisInputObject) Value ¶
func (o GCAxisInputObject) Value() float32
The value along the axis, in unit coordinates.
See: https://developer.apple.com/documentation/GameController/GCAxisInput/value
func (GCAxisInputObject) ValueDidChangeHandler ¶
func (o GCAxisInputObject) ValueDidChangeHandler() func(objc.ID, float32)
The block that the input object calls when the value changes.
See: https://developer.apple.com/documentation/GameController/GCAxisInput/valueDidChangeHandler
type GCButtonElement ¶
type GCButtonElement interface {
objectivec.IObject
GCPhysicalInputElement
// The input object that provides the touch state of the element.
//
// See: https://developer.apple.com/documentation/GameController/GCButtonElement/touchedInput
TouchedInput() GCTouchedStateInput
// The input object that provides the linear and press state of the element.
//
// See: https://developer.apple.com/documentation/GameController/GCButtonElement/pressedInput
PressedInput() objectivec.IObject
// Get the input containing the measured force applied to the button.
//
// See: https://developer.apple.com/documentation/GameController/GCButtonElement/forceInput
ForceInput() GCLinearInput
}
The common properties of an element that represents a momentary switch, such as a push button.
See: https://developer.apple.com/documentation/GameController/GCButtonElement
type GCButtonElementName ¶
type GCButtonElementName interface {
objectivec.IObject
GCPhysicalInputElementName
}
The names of the button elements.
See: https://developer.apple.com/documentation/GameController/GCButtonElementName-c.protocol
type GCButtonElementNameObject ¶
type GCButtonElementNameObject struct {
objectivec.Object
}
GCButtonElementNameObject wraps an existing Objective-C object that conforms to the GCButtonElementName protocol.
func GCButtonElementNameObjectFromID ¶
func GCButtonElementNameObjectFromID(id objc.ID) GCButtonElementNameObject
GCButtonElementNameObjectFromID constructs a GCButtonElementNameObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (GCButtonElementNameObject) BaseObject ¶
func (o GCButtonElementNameObject) BaseObject() objectivec.Object
type GCButtonElementObject ¶
type GCButtonElementObject struct {
objectivec.Object
}
GCButtonElementObject wraps an existing Objective-C object that conforms to the GCButtonElement protocol.
func GCButtonElementObjectFromID ¶
func GCButtonElementObjectFromID(id objc.ID) GCButtonElementObject
GCButtonElementObjectFromID constructs a GCButtonElementObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (GCButtonElementObject) Aliases ¶
func (o GCButtonElementObject) Aliases() foundation.INSSet
The element’s aliases to use when accessing it with the subscript notation.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElement/aliases
func (GCButtonElementObject) BaseObject ¶
func (o GCButtonElementObject) BaseObject() objectivec.Object
func (GCButtonElementObject) ForceInput ¶
func (o GCButtonElementObject) ForceInput() GCLinearInput
Get the input containing the measured force applied to the button.
See: https://developer.apple.com/documentation/GameController/GCButtonElement/forceInput
func (GCButtonElementObject) LocalizedName ¶
func (o GCButtonElementObject) LocalizedName() string
The localized name for the element.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElement/localizedName
func (GCButtonElementObject) PressedInput ¶
func (o GCButtonElementObject) PressedInput() objectivec.IObject
The input object that provides the linear and press state of the element.
See: https://developer.apple.com/documentation/GameController/GCButtonElement/pressedInput
func (GCButtonElementObject) SfSymbolsName ¶
func (o GCButtonElementObject) SfSymbolsName() string
A system symbol for the element.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElement/sfSymbolsName
func (GCButtonElementObject) TouchedInput ¶
func (o GCButtonElementObject) TouchedInput() GCTouchedStateInput
The input object that provides the touch state of the element.
See: https://developer.apple.com/documentation/GameController/GCButtonElement/touchedInput
type GCColor ¶
type GCColor struct {
objectivec.Object
}
The color of a device light.
Creating colors ¶
- GCColor.InitWithRedGreenBlue: Creates a color with the specified red, green, and blue values.
Setting color values ¶
- GCColor.Red: The normalized value of the red component ranging from 0 to 1.
- GCColor.Green: The normalized value of the green component ranging from 0 to 1.
- GCColor.Blue: The normalized value of the blue component ranging from 0 to 1.
See: https://developer.apple.com/documentation/GameController/GCColor
func GCColorFromID ¶
GCColorFromID constructs a GCColor from an objc.ID.
The color of a device light.
func NewGCColorWithRedGreenBlue ¶
Creates a color with the specified red, green, and blue values.
red: The normalized value of the red component ranging from 0 to 1.
green: The normalized value of the green component ranging from 0 to 1.
blue: The normalized value of the blue component ranging from 0 to 1.
See: https://developer.apple.com/documentation/GameController/GCColor/init(red:green:blue:)
func (GCColor) Autorelease ¶
Autorelease adds the receiver to the current autorelease pool.
func (GCColor) Blue ¶
The normalized value of the blue component ranging from 0 to 1.
See: https://developer.apple.com/documentation/GameController/GCColor/blue
func (GCColor) Color ¶
The color of a device’s light.
See: https://developer.apple.com/documentation/gamecontroller/gcdevicelight/color
func (GCColor) EncodeWithCoder ¶
func (g GCColor) EncodeWithCoder(coder foundation.INSCoder)
func (GCColor) Green ¶
The normalized value of the green component ranging from 0 to 1.
See: https://developer.apple.com/documentation/GameController/GCColor/green
func (GCColor) InitWithRedGreenBlue ¶
Creates a color with the specified red, green, and blue values.
red: The normalized value of the red component ranging from 0 to 1.
green: The normalized value of the green component ranging from 0 to 1.
blue: The normalized value of the blue component ranging from 0 to 1.
See: https://developer.apple.com/documentation/GameController/GCColor/init(red:green:blue:)
func (GCColor) Red ¶
The normalized value of the red component ranging from 0 to 1.
See: https://developer.apple.com/documentation/GameController/GCColor/red
type GCColorClass ¶
type GCColorClass struct {
// contains filtered or unexported fields
}
func GetGCColorClass ¶
func GetGCColorClass() GCColorClass
GetGCColorClass returns the class object for GCColor.
func (GCColorClass) Alloc ¶
func (gc GCColorClass) Alloc() GCColor
Alloc allocates memory for a new instance of the class.
func (GCColorClass) Class ¶
func (gc GCColorClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type GCController ¶
type GCController struct {
objectivec.Object
}
A representation of a real game controller, a virtual controller, or a snapshot of a controller.
Overview ¶
This class represents a real or virtual controller that a user interacts with during a game. A is a physical controller that connects directly or wirelessly to the device. A real controller can be formfitting or can attach closely to a device so players can use controls on both simultaneously. A is a software emulation of a real controller.
You discover controllers, and then you process the input from those controllers during gameplay. Use the [GCController.Controllers] method to get the currently connected controllers. If necessary, use the [GCController.StartWirelessControllerDiscoveryWithCompletionHandler] method to connect with wireless controllers.
This framework supports multiple connected game controllers. To identify which player is using a controller in a multiplayer game, check the GCController.PlayerIndex property and set it, if necessary. For single-player games, use the [GCController.Current] property to get the controller that the player is actively using.
A controller’s profile encapsulates the details about a controller’s buttons, pads, axis, and other input elements. Get the controller’s profile using one of the profile properties, such as GCController.ExtendedGamepad, and then process the input from its elements.
You can either get the values of input elements on each iteration of your game loop, or set handlers to receive callbacks when those values change. For example, use the GCController.LeftThumbstick property of the GCExtendedGamepad profile to get the thumbstick state. Use the GCController.ValueChangedHandler property to set a handler that you implement to process any input values that change in the profile.
Alternatively, you can create a snapshot of a real or virtual controller using the GCController.Capture method. A is a copy of a controller at a moment in time with its current element values. Creating a snapshot may impact performance, and over time a snapshot doesn’t stay current. Unlike other types of controllers, you can set the values of elements in a snapshot.
Discovering controllers ¶
- GCController.GCControllerDidConnect: A notification that posts after a controller connects to the device.
- GCController.GCControllerDidDisconnect: A notification that posts after a controller disconnects from the device.
Handling multiple controllers ¶
- GCController.GCControllerDidBecomeCurrent: A notification that posts when a controller becomes the current controller.
- GCController.GCControllerDidStopBeingCurrent: A notification that posts when a controller stops being the current controller.
Inspecting a controller ¶
- GCController.AttachedToDevice: A Boolean value that indicates whether the controller closely integrates with the device.
Accessing controller input ¶
- GCController.Input: The input profile for the controller.
Accessing controller profiles ¶
- GCController.ExtendedGamepad: The extended gamepad profile.
- GCController.MicroGamepad: The micro gamepad profile.
- GCController.Motion: The motion input profile.
Identifying controllers and displaying a player index ¶
- GCController.PlayerIndex: The player index for the controller.
- GCController.SetPlayerIndex
Accessing battery, haptics, and light objects ¶
- GCController.Battery: The controller’s battery information.
- GCController.Haptics: The controller’s haptics information.
- GCController.Light: The controller’s light settings.
Creating snapshots ¶
- GCController.Capture: Returns a snapshot of the controller with its current element values.
- GCController.Snapshot: A Boolean value that indicates whether the controller is a snapshot of a controller.
See: https://developer.apple.com/documentation/GameController/GCController
func GCControllerFromID ¶
func GCControllerFromID(id objc.ID) GCController
GCControllerFromID constructs a GCController from an objc.ID.
A representation of a real game controller, a virtual controller, or a snapshot of a controller.
func NewGCController ¶
func NewGCController() GCController
NewGCController creates a new GCController instance.
func (GCController) AttachedToDevice ¶
func (g GCController) AttachedToDevice() bool
A Boolean value that indicates whether the controller closely integrates with the device.
Discussion ¶
If true, the controller may be formfitting or otherwise closely attach to the device so that the player can interact simultaneously with the controller and the device. If false, the controller doesn’t have an attachment to the device.
See: https://developer.apple.com/documentation/GameController/GCController/isAttachedToDevice
func (GCController) Autorelease ¶
func (g GCController) Autorelease() GCController
Autorelease adds the receiver to the current autorelease pool.
func (GCController) Battery ¶
func (g GCController) Battery() IGCDeviceBattery
The controller’s battery information.
Discussion ¶
Use this property to display the battery life or to warn the user when the controller’s battery level is low. If the controller doesn’t provide battery information, this property is `nil`.
See: https://developer.apple.com/documentation/GameController/GCController/battery
func (GCController) Capture ¶
func (g GCController) Capture() IGCController
Returns a snapshot of the controller with its current element values.
Return Value ¶
A snapshot of the controller.
Discussion ¶
A snapshot is a copy of a real or virtual controller at a moment in time with its current element values. Unlike other controllers, you can set the values of a snapshot’s GCControllerElement objects.
See: https://developer.apple.com/documentation/GameController/GCController/capture()
func (GCController) ExtendedGamepad ¶
func (g GCController) ExtendedGamepad() IGCExtendedGamepad
The extended gamepad profile.
Discussion ¶
If the controller supports the extended gamepad profile, this property is a GCExtendedGamepad object that you use to access the input elements of the controller. If the controller doesn’t support the extended gamepad profile, this property is `nil`.
See: https://developer.apple.com/documentation/GameController/GCController/extendedGamepad
func (GCController) GCControllerDidBecomeCurrent ¶
func (g GCController) GCControllerDidBecomeCurrent() foundation.NSString
A notification that posts when a controller becomes the current controller.
func (GCController) GCControllerDidConnect ¶
func (g GCController) GCControllerDidConnect() foundation.NSString
A notification that posts after a controller connects to the device.
func (GCController) GCControllerDidDisconnect ¶
func (g GCController) GCControllerDidDisconnect() foundation.NSString
A notification that posts after a controller disconnects from the device.
func (GCController) GCControllerDidStopBeingCurrent ¶
func (g GCController) GCControllerDidStopBeingCurrent() foundation.NSString
A notification that posts when a controller stops being the current controller.
func (GCController) HandlerQueue ¶
func (g GCController) HandlerQueue() dispatch.Queue
The dispatch queue that the framework uses to call element value change handlers.
Discussion ¶
The default queue is the main queue. Set this property to another queue to asynchronously call value change handlers (see GCControllerAxisInput, GCControllerButtonInput, GCControllerDirectionPad, and GCMotion). For example, if you handle input on another queue, set this property when you first access the input device.
See: https://developer.apple.com/documentation/GameController/GCDevice/handlerQueue
func (GCController) Haptics ¶
func (g GCController) Haptics() IGCDeviceHaptics
The controller’s haptics information.
Discussion ¶
Use this property to create CHHapticEngine instances as necessary in your app. If the controller doesn’t provide haptics information, this property is `nil`.
See: https://developer.apple.com/documentation/GameController/GCController/haptics
func (GCController) Input ¶
func (g GCController) Input() IGCControllerLiveInput
The input profile for the controller.
See: https://developer.apple.com/documentation/GameController/GCController/input
func (GCController) LeftThumbstick ¶
func (g GCController) LeftThumbstick() IGCControllerDirectionPad
The controller’s left thumbstick element.
See: https://developer.apple.com/documentation/gamecontroller/gcextendedgamepad/leftthumbstick
func (GCController) Light ¶
func (g GCController) Light() IGCDeviceLight
The controller’s light settings.
Discussion ¶
Use the light settings to signal the user or to create a more immersive experience. If the controller doesn’t provide light settings, this property is `nil`.
See: https://developer.apple.com/documentation/GameController/GCController/light
func (GCController) MicroGamepad ¶
func (g GCController) MicroGamepad() IGCMicroGamepad
The micro gamepad profile.
Discussion ¶
If the controller supports the micro gamepad profile, this property is a GCMicroGamepad object that you use to access the input elements of the controller. If the controller doesn’t support the micro gamepad profile, this property is `nil`.
See: https://developer.apple.com/documentation/GameController/GCController/microGamepad
func (GCController) Motion ¶
func (g GCController) Motion() IGCMotion
The motion input profile.
Discussion ¶
If the controller supports the motion profile, this property is a GCMotion object that you use to access the controller’s motion data. If the controller doesn’t support the motion input profile, this property is `nil`.
See: https://developer.apple.com/documentation/GameController/GCController/motion
func (GCController) PhysicalInputProfile ¶
func (g GCController) PhysicalInputProfile() IGCPhysicalInputProfile
The physical input profile for the controller.
Discussion ¶
This is a convenience property that returns the [ExtendedGamepad] or [MicroGamepad] properties.
See: https://developer.apple.com/documentation/GameController/GCController/physicalInputProfile
func (GCController) PlayerIndex ¶
func (g GCController) PlayerIndex() GCControllerPlayerIndex
The player index for the controller.
Discussion ¶
Use the player index to identify which player is using the controller. Set the player index when the controller first connects to the device and you configure your game.
When you set the player index, the matching LED on the controller for that player lights up. You don’t need to provide a unique player index for each active game controller. For example, players on the same team can share a common player index. If your game no longer uses a controller, set the controller’s index value to GCControllerPlayerIndex.indexUnset.
The default value for this property is GCControllerPlayerIndex.indexUnset.
See: https://developer.apple.com/documentation/GameController/GCController/playerIndex
func (GCController) ProductCategory ¶
func (g GCController) ProductCategory() string
The product category that identifies the type of controller.
See: https://developer.apple.com/documentation/GameController/GCDevice/productCategory
func (GCController) SetHandlerQueue ¶
func (g GCController) SetHandlerQueue(value dispatch.Queue)
func (GCController) SetLeftThumbstick ¶
func (g GCController) SetLeftThumbstick(value IGCControllerDirectionPad)
func (GCController) SetPlayerIndex ¶
func (g GCController) SetPlayerIndex(value GCControllerPlayerIndex)
func (GCController) SetValueChangedHandler ¶
func (g GCController) SetValueChangedHandler(value GCExtendedGamepadValueChangedHandler)
func (GCController) Snapshot ¶
func (g GCController) Snapshot() bool
A Boolean value that indicates whether the controller is a snapshot of a controller.
Discussion ¶
If true, the controller is a snapshot of a controller. A snapshot is a copy of a real or virtual controller at a moment in time with its current element values. If false, the controller is a real or virtual controller.
See: https://developer.apple.com/documentation/GameController/GCController/isSnapshot
func (GCController) ValueChangedHandler ¶
func (g GCController) ValueChangedHandler() GCExtendedGamepadValueChangedHandler
The block that the profile calls when an element’s value changes.
See: https://developer.apple.com/documentation/gamecontroller/gcextendedgamepad/valuechangedhandler
func (GCController) VendorName ¶
func (g GCController) VendorName() string
The manufacturer-provided name for the device, or the user’s name for the device.
Discussion ¶
The value of this property may be `nil` and may not be unique. Use this property to present information about the device to the user.
See: https://developer.apple.com/documentation/GameController/GCDevice/vendorName
type GCControllerAxisInput ¶
type GCControllerAxisInput struct {
GCControllerElement
}
A control element that tracks movement along an axis.
Overview ¶
A GCControllerAxisInput object represents the value of a physical controller’s axis. For example, a GCControllerDirectionPad has x-axis and y-axis subelements.
Accessing the input values ¶
- GCControllerAxisInput.Value: The current value of the axis.
Getting change information ¶
- GCControllerAxisInput.ValueChangedHandler: The block that the element calls when the user changes the axis value.
- GCControllerAxisInput.SetValueChangedHandler
See: https://developer.apple.com/documentation/GameController/GCControllerAxisInput
func GCControllerAxisInputFromID ¶
func GCControllerAxisInputFromID(id objc.ID) GCControllerAxisInput
GCControllerAxisInputFromID constructs a GCControllerAxisInput from an objc.ID.
A control element that tracks movement along an axis.
func NewGCControllerAxisInput ¶
func NewGCControllerAxisInput() GCControllerAxisInput
NewGCControllerAxisInput creates a new GCControllerAxisInput instance.
func (GCControllerAxisInput) Autorelease ¶
func (g GCControllerAxisInput) Autorelease() GCControllerAxisInput
Autorelease adds the receiver to the current autorelease pool.
func (GCControllerAxisInput) Init ¶
func (g GCControllerAxisInput) Init() GCControllerAxisInput
Init initializes the instance.
func (GCControllerAxisInput) SetValueChangedHandler ¶
func (g GCControllerAxisInput) SetValueChangedHandler(value GCControllerAxisValueChangedHandler)
func (GCControllerAxisInput) Value ¶
func (g GCControllerAxisInput) Value() float32
The current value of the axis.
Discussion ¶
Often a physical controller ignores values near the neutral position called the dead zone. The GCControllerAxisInput element handles this dead zone, and other physical constraints of a hardware control, by computing a normalized value.
The normalized value ranges from `-1` to `1`. If the value is `0`, the movement is in the dead zone. A nonzero value indicates the moment is outside of the dead zone.
See: https://developer.apple.com/documentation/GameController/GCControllerAxisInput/value
func (GCControllerAxisInput) ValueChangedHandler ¶
func (g GCControllerAxisInput) ValueChangedHandler() GCControllerAxisValueChangedHandler
The block that the element calls when the user changes the axis value.
See: https://developer.apple.com/documentation/GameController/GCControllerAxisInput/valueChangedHandler
type GCControllerAxisInputClass ¶
type GCControllerAxisInputClass struct {
// contains filtered or unexported fields
}
func GetGCControllerAxisInputClass ¶
func GetGCControllerAxisInputClass() GCControllerAxisInputClass
GetGCControllerAxisInputClass returns the class object for GCControllerAxisInput.
func (GCControllerAxisInputClass) Alloc ¶
func (gc GCControllerAxisInputClass) Alloc() GCControllerAxisInput
Alloc allocates memory for a new instance of the class.
func (GCControllerAxisInputClass) Class ¶
func (gc GCControllerAxisInputClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type GCControllerAxisValueChangedHandler ¶
type GCControllerAxisValueChangedHandler = func(GCControllerAxisInput, float32)
GCControllerAxisValueChangedHandler is the signature for the block that executes when the user changes the axis value.
See: https://developer.apple.com/documentation/GameController/GCControllerAxisValueChangedHandler
type GCControllerButtonInput ¶
type GCControllerButtonInput struct {
GCControllerElement
}
A control element that represents a button touch or press.
Overview ¶
A GCControllerButtonInput object represents a button on a controller that can report either analog or digital values.
Accessing input values ¶
- GCControllerButtonInput.Touched: A Boolean value that indicates whether the user is touching the button.
- GCControllerButtonInput.Pressed: A Boolean value that indicates whether the user is pressing the button.
- GCControllerButtonInput.Value: The level of pressure the user is applying to the button.
Getting change information ¶
- GCControllerButtonInput.TouchedChangedHandler: The block that the element calls when the user touches the button.
- GCControllerButtonInput.SetTouchedChangedHandler
- GCControllerButtonInput.PressedChangedHandler: The block that the element calls when the user presses or releases the button.
- GCControllerButtonInput.SetPressedChangedHandler
- GCControllerButtonInput.ValueChangedHandler: The block that the element calls when the user changes the level of pressure on the button.
- GCControllerButtonInput.SetValueChangedHandler
See: https://developer.apple.com/documentation/GameController/GCControllerButtonInput
func GCControllerButtonInputFromID ¶
func GCControllerButtonInputFromID(id objc.ID) GCControllerButtonInput
GCControllerButtonInputFromID constructs a GCControllerButtonInput from an objc.ID.
A control element that represents a button touch or press.
func NewGCControllerButtonInput ¶
func NewGCControllerButtonInput() GCControllerButtonInput
NewGCControllerButtonInput creates a new GCControllerButtonInput instance.
func (GCControllerButtonInput) Autorelease ¶
func (g GCControllerButtonInput) Autorelease() GCControllerButtonInput
Autorelease adds the receiver to the current autorelease pool.
func (GCControllerButtonInput) Init ¶
func (g GCControllerButtonInput) Init() GCControllerButtonInput
Init initializes the instance.
func (GCControllerButtonInput) Pressed ¶
func (g GCControllerButtonInput) Pressed() bool
A Boolean value that indicates whether the user is pressing the button.
Discussion ¶
If this property is true, the user is putting pressure on the button; otherwise, the user isn’t.
For the DualSense, DualShock 4, and Siri Remote controllers, the framework simulates whether the user presses the button and the level of pressure for its touch surfaces.
See: https://developer.apple.com/documentation/GameController/GCControllerButtonInput/isPressed
func (GCControllerButtonInput) PressedChangedHandler ¶
func (g GCControllerButtonInput) PressedChangedHandler() GCControllerButtonValueChangedHandler
The block that the element calls when the user presses or releases the button.
Discussion ¶
Set this handler when you only want to know when the user presses or releases the button — that is, when the [Pressed] property changes.
func (GCControllerButtonInput) SetPressedChangedHandler ¶
func (g GCControllerButtonInput) SetPressedChangedHandler(value GCControllerButtonValueChangedHandler)
func (GCControllerButtonInput) SetTouchedChangedHandler ¶
func (g GCControllerButtonInput) SetTouchedChangedHandler(value GCControllerButtonTouchedChangedHandler)
func (GCControllerButtonInput) SetValueChangedHandler ¶
func (g GCControllerButtonInput) SetValueChangedHandler(value GCControllerButtonValueChangedHandler)
func (GCControllerButtonInput) Touched ¶
func (g GCControllerButtonInput) Touched() bool
A Boolean value that indicates whether the user is touching the button.
Discussion ¶
If this property is true, the user is touching the button; otherwise, the user isn’t. For controllers that support capacitive touch, the user can start touching the button without pressure when the value property is `0`. For controllers that don’t support capacitive touch, the user starts touching the button when the value property is greater than `0`.
See: https://developer.apple.com/documentation/GameController/GCControllerButtonInput/isTouched
func (GCControllerButtonInput) TouchedChangedHandler ¶
func (g GCControllerButtonInput) TouchedChangedHandler() GCControllerButtonTouchedChangedHandler
The block that the element calls when the user touches the button.
Discussion ¶
Set this handler when you want to know when the user touches the button before pressing the button.
func (GCControllerButtonInput) Value ¶
func (g GCControllerButtonInput) Value() float32
The level of pressure the user is applying to the button.
Discussion ¶
If the user applies pressure to the button, the [Pressed] property is true and this property indicates the amount of pressure. The framework normalizes the value to a number between `0.0` (minimum) and `1.0` (maximum). If the user isn’t pressing the button, the [Pressed] property is false and this property is `0.0`.
For axis buttons, such as thumbsticks and touchpads, the location on the positive or negative axis of the element simulates the pressure.
See: https://developer.apple.com/documentation/GameController/GCControllerButtonInput/value
func (GCControllerButtonInput) ValueChangedHandler ¶
func (g GCControllerButtonInput) ValueChangedHandler() GCControllerButtonValueChangedHandler
The block that the element calls when the user changes the level of pressure on the button.
Discussion ¶
Set this handler when you want to know when the pressure level changes.
See: https://developer.apple.com/documentation/GameController/GCControllerButtonInput/valueChangedHandler
type GCControllerButtonInputClass ¶
type GCControllerButtonInputClass struct {
// contains filtered or unexported fields
}
func GetGCControllerButtonInputClass ¶
func GetGCControllerButtonInputClass() GCControllerButtonInputClass
GetGCControllerButtonInputClass returns the class object for GCControllerButtonInput.
func (GCControllerButtonInputClass) Alloc ¶
func (gc GCControllerButtonInputClass) Alloc() GCControllerButtonInput
Alloc allocates memory for a new instance of the class.
func (GCControllerButtonInputClass) Class ¶
func (gc GCControllerButtonInputClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type GCControllerButtonTouchedChangedHandler ¶
type GCControllerButtonTouchedChangedHandler = func(GCControllerButtonInput, float32, bool, bool)
GCControllerButtonTouchedChangedHandler is the signature for the block that executes when the user touches the button if the controller supports that feature.
See: https://developer.apple.com/documentation/GameController/GCControllerButtonTouchedChangedHandler
type GCControllerButtonValueChangedHandler ¶
type GCControllerButtonValueChangedHandler = func(GCControllerButtonInput, float32, bool)
GCControllerButtonValueChangedHandler is the signature for the block that executes when a button’s state changes.
See: https://developer.apple.com/documentation/GameController/GCControllerButtonValueChangedHandler
type GCControllerClass ¶
type GCControllerClass struct {
// contains filtered or unexported fields
}
func GetGCControllerClass ¶
func GetGCControllerClass() GCControllerClass
GetGCControllerClass returns the class object for GCController.
func (GCControllerClass) Alloc ¶
func (gc GCControllerClass) Alloc() GCController
Alloc allocates memory for a new instance of the class.
func (GCControllerClass) Class ¶
func (gc GCControllerClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
func (GCControllerClass) ControllerWithExtendedGamepad ¶
func (_GCControllerClass GCControllerClass) ControllerWithExtendedGamepad() GCController
Returns a snapshot of a newly created controller with an extended gamepad profile.
Return Value ¶
A snapshot with an extended gamepad profile.
Discussion ¶
A snapshot is a copy of a real or virtual controller at a moment in time with its current element values. Unlike other controllers, you can set the values of a snapshot’s GCControllerElement objects.
See: https://developer.apple.com/documentation/GameController/GCController/withExtendedGamepad()
func (GCControllerClass) ControllerWithMicroGamepad ¶
func (_GCControllerClass GCControllerClass) ControllerWithMicroGamepad() GCController
Returns a snapshot of a newly created controller with a micro gamepad profile.
Return Value ¶
A snapshot with a micro gamepad profile.
Discussion ¶
A snapshot is a copy of a real or virtual controller at a moment in time with its current element values. Unlike other controllers, you can set the values of a snapshot’s GCControllerElement objects.
See: https://developer.apple.com/documentation/GameController/GCController/withMicroGamepad()
func (GCControllerClass) Controllers ¶
func (_GCControllerClass GCControllerClass) Controllers() []GCController
Returns the connected controllers for the device.
Return Value ¶
The currently connected controllers.
Discussion ¶
To track the connection status of controllers, observe the framework notifications. The framework posts the [GCControllerDidConnect] (Swift) and [GCControllerDidBecomeCurrent] (Swift) notifications when a controller connects to a device. For Objective-C, it posts the GCControllerDidConnectNotification and GCControllerDidBecomeCurrentNotification notifications. When a controller disconnects from a device, it posts the [GCControllerDidDisconnect] (Swift) and [GCControllerDidStopBeingCurrent] (Swift) notifications. For Objective-C, it posts the GCControllerDidDisconnectNotification and GCControllerDidStopBeingCurrentNotification notifications.
See: https://developer.apple.com/documentation/GameController/GCController/controllers()
func (GCControllerClass) Current ¶
func (_GCControllerClass GCControllerClass) Current() GCController
The most recently used game controller.
Discussion ¶
Use this property for a single-player game when you don’t need to distinguish the input from multiple controllers simultaneously.
See: https://developer.apple.com/documentation/GameController/GCController/current
func (GCControllerClass) SetShouldMonitorBackgroundEvents ¶
func (_GCControllerClass GCControllerClass) SetShouldMonitorBackgroundEvents(value bool)
func (GCControllerClass) ShouldMonitorBackgroundEvents ¶
func (_GCControllerClass GCControllerClass) ShouldMonitorBackgroundEvents() bool
A Boolean value that indicates whether the app needs to respond to controller events when it isn’t the frontmost app.
Discussion ¶
If false, and the app isn’t in the foreground, the framework doesn’t forward any input from the game controller until the app becomes the frontmost.
See: https://developer.apple.com/documentation/GameController/GCController/shouldMonitorBackgroundEvents
func (GCControllerClass) StartWirelessControllerDiscovery ¶
func (gc GCControllerClass) StartWirelessControllerDiscovery(ctx context.Context) error
StartWirelessControllerDiscovery is a synchronous wrapper around [GCController.StartWirelessControllerDiscoveryWithCompletionHandler]. It blocks until the completion handler fires or the context is cancelled.
func (GCControllerClass) StartWirelessControllerDiscoveryWithCompletionHandler ¶
func (_GCControllerClass GCControllerClass) StartWirelessControllerDiscoveryWithCompletionHandler(completionHandler VoidHandler)
Starts searching for nearby wireless controllers.
completionHandler: The block that the framework calls when it completes the request.
Discussion ¶
Call this method when the user chooses to discover wireless controllers from your interface. The framework searches asynchronously for discoverable wireless controllers. The framework posts the [GCControllerDidConnect] (Swift) or GCControllerDidConnectNotification (Objective-C) notification when it discovers new controllers. Implement the completion handler you pass to this method to handle when the framework finishes discovering controllers or when it times out.
If you call the [StartWirelessControllerDiscoveryWithCompletionHandler] method multiple times during discovery, the framework only calls the last completion handler you pass to this method.
func (GCControllerClass) StopWirelessControllerDiscovery ¶
func (_GCControllerClass GCControllerClass) StopWirelessControllerDiscovery()
Stops searching for nearby wireless controllers.
Discussion ¶
If you call this method while the framework searches for wireless controllers, the framework stops searching and invokes the completion handler you pass to the [StartWirelessControllerDiscoveryWithCompletionHandler] method.
func (GCControllerClass) SupportsHIDDevice ¶
func (_GCControllerClass GCControllerClass) SupportsHIDDevice(device iokit.IOHIDDeviceRef) bool
Returns a Boolean value that indicates whether the framework supports the specified human interface device.
device: A human interface input device.
Return Value ¶
true if the framework supports the device; otherwise, false.
Discussion ¶
If the Game Controller framework supports the input device, you can use the Game Controller APIs to interact with the device instead of the IOKit APIs.
See: https://developer.apple.com/documentation/GameController/GCController/supportsHIDDevice(_:)
type GCControllerDirectionPad ¶
type GCControllerDirectionPad struct {
GCControllerElement
}
A control element associated with a directional pad or a thumbstick.
Overview ¶
You get the input values for this element from its subelements. You can use either the GCControllerDirectionPad.XAxis and GCControllerDirectionPad.YAxis properties to get coordinates, or the GCControllerDirectionPad.Up, GCControllerDirectionPad.Down, GCControllerDirectionPad.Left, and GCControllerDirectionPad.Right buttons that simulate directional pad buttons.
Accessing values using the axes ¶
- GCControllerDirectionPad.XAxis: The x-axis element of the directional pad.
- GCControllerDirectionPad.YAxis: The y-axis element of the directional pad.
Accessing values using directional buttons ¶
- GCControllerDirectionPad.Right: The button element that changes the positive x-axis.
- GCControllerDirectionPad.Left: The button element that changes the negative x-axis.
- GCControllerDirectionPad.Up: The button element that changes the positive y-axis.
- GCControllerDirectionPad.Down: The button element used for the negative y-axis direction.
Getting change information ¶
- GCControllerDirectionPad.ValueChangedHandler: The block that the directional pad calls when the user changes its values.
- GCControllerDirectionPad.SetValueChangedHandler
Setting snapshot values ¶
- GCControllerDirectionPad.SetValueForXAxisYAxis: Sets the input values of a snapshot of a directional pad.
See: https://developer.apple.com/documentation/GameController/GCControllerDirectionPad
func GCControllerDirectionPadFromID ¶
func GCControllerDirectionPadFromID(id objc.ID) GCControllerDirectionPad
GCControllerDirectionPadFromID constructs a GCControllerDirectionPad from an objc.ID.
A control element associated with a directional pad or a thumbstick.
func NewGCControllerDirectionPad ¶
func NewGCControllerDirectionPad() GCControllerDirectionPad
NewGCControllerDirectionPad creates a new GCControllerDirectionPad instance.
func (GCControllerDirectionPad) Autorelease ¶
func (g GCControllerDirectionPad) Autorelease() GCControllerDirectionPad
Autorelease adds the receiver to the current autorelease pool.
func (GCControllerDirectionPad) Down ¶
func (g GCControllerDirectionPad) Down() IGCControllerButtonInput
The button element used for the negative y-axis direction.
Discussion ¶
The value of the `up` and `down` buttons are mutually exclusive because the user can only press one of these buttons at a time. Therefore, when the `down` button is nonzero, the `up` button is `0`.
See: https://developer.apple.com/documentation/GameController/GCControllerDirectionPad/down
func (GCControllerDirectionPad) Init ¶
func (g GCControllerDirectionPad) Init() GCControllerDirectionPad
Init initializes the instance.
func (GCControllerDirectionPad) Left ¶
func (g GCControllerDirectionPad) Left() IGCControllerButtonInput
The button element that changes the negative x-axis.
Discussion ¶
The value of the `right` and `left` buttons are mutually exclusive because the user can only press one of these buttons at a time. Therefore, when the `left` button is nonzero, the `right` button is `0`.
See: https://developer.apple.com/documentation/GameController/GCControllerDirectionPad/left
func (GCControllerDirectionPad) Right ¶
func (g GCControllerDirectionPad) Right() IGCControllerButtonInput
The button element that changes the positive x-axis.
Discussion ¶
The value of the `right` and `left` buttons are mutually exclusive because the user can only press one of these buttons at a time. Therefore, when the `right` button is nonzero, the `left` button is `0`.
See: https://developer.apple.com/documentation/GameController/GCControllerDirectionPad/right
func (GCControllerDirectionPad) SetValueChangedHandler ¶
func (g GCControllerDirectionPad) SetValueChangedHandler(value GCControllerDirectionPadValueChangedHandler)
func (GCControllerDirectionPad) SetValueForXAxisYAxis ¶
func (g GCControllerDirectionPad) SetValueForXAxisYAxis(xAxis float32, yAxis float32)
Sets the input values of a snapshot of a directional pad.
xAxis: A normalized value of the x-axis ranging from `-1` to `1`.
yAxis: A normalized value for the y-axis ranging from `-1` to `1`.
Discussion ¶
This method does nothing if the associated controller isn’t a snapshot (its [Snapshot] property is false`)`. Otherwise, this method sets the value of the direction pad’s buttons as well.
func (GCControllerDirectionPad) Up ¶
func (g GCControllerDirectionPad) Up() IGCControllerButtonInput
The button element that changes the positive y-axis.
Discussion ¶
The value of the `up` and `down` buttons are mutually exclusive because the user can only press one of these buttons at a time. Therefore, when the `up` button is nonzero, the `down` button is `0`.
See: https://developer.apple.com/documentation/GameController/GCControllerDirectionPad/up
func (GCControllerDirectionPad) ValueChangedHandler ¶
func (g GCControllerDirectionPad) ValueChangedHandler() GCControllerDirectionPadValueChangedHandler
The block that the directional pad calls when the user changes its values.
Discussion ¶
Set this handler to receive notifications when the user changes a direction value.
func (GCControllerDirectionPad) XAxis ¶
func (g GCControllerDirectionPad) XAxis() IGCControllerAxisInput
The x-axis element of the directional pad.
See: https://developer.apple.com/documentation/GameController/GCControllerDirectionPad/xAxis
func (GCControllerDirectionPad) YAxis ¶
func (g GCControllerDirectionPad) YAxis() IGCControllerAxisInput
The y-axis element of the directional pad.
See: https://developer.apple.com/documentation/GameController/GCControllerDirectionPad/yAxis
type GCControllerDirectionPadClass ¶
type GCControllerDirectionPadClass struct {
// contains filtered or unexported fields
}
func GetGCControllerDirectionPadClass ¶
func GetGCControllerDirectionPadClass() GCControllerDirectionPadClass
GetGCControllerDirectionPadClass returns the class object for GCControllerDirectionPad.
func (GCControllerDirectionPadClass) Alloc ¶
func (gc GCControllerDirectionPadClass) Alloc() GCControllerDirectionPad
Alloc allocates memory for a new instance of the class.
func (GCControllerDirectionPadClass) Class ¶
func (gc GCControllerDirectionPadClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type GCControllerDirectionPadValueChangedHandler ¶
type GCControllerDirectionPadValueChangedHandler = func(GCControllerDirectionPad, float32, float32)
GCControllerDirectionPadValueChangedHandler is the signature for the block that executes when either axis changes values.
See: https://developer.apple.com/documentation/GameController/GCControllerDirectionPadValueChangedHandler
type GCControllerElement ¶
type GCControllerElement struct {
objectivec.Object
}
An input for a physical control, such as a button or thumbstick.
Overview ¶
GCControllerElement is an abstract superclass for specific types of elements that represent controls on a game controller. Use the respective subclasses to either get the input of an element directly or set a handler that the element calls when the user changes a value. This class provides support for common features.
For complex elements that have subelements, you can get the containing element using the GCControllerElement.Collection property. For example, a direction pad (GCControllerDirectionPad) has two axis control and four button subelements.
If the user binds a controller element to a system gesture, the system sends the input to the system gesture recognizer first. If it doesn’t recognize a gesture, the system sends the input to your app but with a delay. If it does recognize a gesture, it doesn’t send any input to your app.
To change this default behavior, you can set the GCControllerElement.PreferredSystemGestureState property to GCControllerElement.SystemGestureState.alwaysReceive to receive the input simultaneously without delay. Alternatively, set it to GCControllerElement.SystemGestureState.disabled to disable the system gesture and receive the input exclusively. Use the GCControllerElement.BoundToSystemGesture property to check whether the user included an element in a system gesture.
Use the GCControllerElement.Analog property to determine whether an element’s input value is a range of values or a discrete digital value.
Accessing input values ¶
- GCControllerElement.Analog: A Boolean value that indicates whether the element provides analog data.
Getting a localized name ¶
- GCControllerElement.LocalizedName: The localized name for the element or the remapped element.
- GCControllerElement.SetLocalizedName
- GCControllerElement.UnmappedLocalizedName: The element’s localized name, not the remapped name.
- GCControllerElement.SetUnmappedLocalizedName
Displaying a symbol ¶
- GCControllerElement.SfSymbolsName: A system symbol for the element or the remapped element.
- GCControllerElement.SetSfSymbolsName
- GCControllerElement.UnmappedSfSymbolsName: The element’s system symbol, not the remapped symbol.
- GCControllerElement.SetUnmappedSfSymbolsName
Accessing elements by key ¶
- GCControllerElement.Aliases: The element’s aliases you use when accessing it with the subscript notation.
Getting the containing element ¶
- GCControllerElement.Collection: The enclosing element for this element.
Handling system gesture input ¶
- GCControllerElement.BoundToSystemGesture: A Boolean value that indicates whether the user binds the element to a system gesture.
- GCControllerElement.PreferredSystemGestureState: The preferred state for handling input when the user binds the element to a system gesture.
- GCControllerElement.SetPreferredSystemGestureState
See: https://developer.apple.com/documentation/GameController/GCControllerElement
func GCControllerElementFromID ¶
func GCControllerElementFromID(id objc.ID) GCControllerElement
GCControllerElementFromID constructs a GCControllerElement from an objc.ID.
An input for a physical control, such as a button or thumbstick.
func NewGCControllerElement ¶
func NewGCControllerElement() GCControllerElement
NewGCControllerElement creates a new GCControllerElement instance.
func (GCControllerElement) Aliases ¶
func (g GCControllerElement) Aliases() foundation.INSSet
The element’s aliases you use when accessing it with the subscript notation.
See: https://developer.apple.com/documentation/GameController/GCControllerElement/aliases
func (GCControllerElement) Analog ¶
func (g GCControllerElement) Analog() bool
A Boolean value that indicates whether the element provides analog data.
Discussion ¶
If this property is true, the input value defined by the element can return a range (from a minimum to maximum) of possible values. For example, this element might be a pressure-sensitive button or an axis of a thumbstick that allows for a range of physical movement. If this property is false, the input value is a discrete value, such as `0` if the element is off, and `1` if the element is on.
See: https://developer.apple.com/documentation/GameController/GCControllerElement/isAnalog
func (GCControllerElement) Autorelease ¶
func (g GCControllerElement) Autorelease() GCControllerElement
Autorelease adds the receiver to the current autorelease pool.
func (GCControllerElement) BoundToSystemGesture ¶
func (g GCControllerElement) BoundToSystemGesture() bool
A Boolean value that indicates whether the user binds the element to a system gesture.
Discussion ¶
This property is true if the user binds this element to a gesture; otherwise, it’s false.
See: https://developer.apple.com/documentation/GameController/GCControllerElement/isBoundToSystemGesture
func (GCControllerElement) Collection ¶
func (g GCControllerElement) Collection() IGCControllerElement
The enclosing element for this element.
Discussion ¶
If this element is part of another element, this property is the containing element; otherwise, it’s `nil`.
See: https://developer.apple.com/documentation/GameController/GCControllerElement/collection
func (GCControllerElement) Init ¶
func (g GCControllerElement) Init() GCControllerElement
Init initializes the instance.
func (GCControllerElement) LocalizedName ¶
func (g GCControllerElement) LocalizedName() string
The localized name for the element or the remapped element.
Discussion ¶
If the user remaps this element, this property is the remapped localized name.
See: https://developer.apple.com/documentation/GameController/GCControllerElement/localizedName
func (GCControllerElement) PreferredSystemGestureState ¶
func (g GCControllerElement) PreferredSystemGestureState() GCSystemGestureState
The preferred state for handling input when the user binds the element to a system gesture.
Discussion ¶
In rare situations, you may use this property to disable system gestures. However, the system isn’t guaranteed to respect this property. The default value for this property is GCControllerElement.SystemGestureState.enabled.
func (GCControllerElement) SetLocalizedName ¶
func (g GCControllerElement) SetLocalizedName(value string)
func (GCControllerElement) SetPreferredSystemGestureState ¶
func (g GCControllerElement) SetPreferredSystemGestureState(value GCSystemGestureState)
func (GCControllerElement) SetSfSymbolsName ¶
func (g GCControllerElement) SetSfSymbolsName(value string)
func (GCControllerElement) SetUnmappedLocalizedName ¶
func (g GCControllerElement) SetUnmappedLocalizedName(value string)
func (GCControllerElement) SetUnmappedSfSymbolsName ¶
func (g GCControllerElement) SetUnmappedSfSymbolsName(value string)
func (GCControllerElement) SfSymbolsName ¶
func (g GCControllerElement) SfSymbolsName() string
A system symbol for the element or the remapped element.
Discussion ¶
If the user remaps this element, this property is the remapped system symbol.
See: https://developer.apple.com/documentation/GameController/GCControllerElement/sfSymbolsName
func (GCControllerElement) UnmappedLocalizedName ¶
func (g GCControllerElement) UnmappedLocalizedName() string
The element’s localized name, not the remapped name.
Discussion ¶
To present the element that a user wants to remap in your interface, use this property to get the original name. Otherwise, use the [LocalizedName] property to get the possibly remapped name.
See: https://developer.apple.com/documentation/GameController/GCControllerElement/unmappedLocalizedName
func (GCControllerElement) UnmappedSfSymbolsName ¶
func (g GCControllerElement) UnmappedSfSymbolsName() string
The element’s system symbol, not the remapped symbol.
Discussion ¶
Use this property to get the original unmapped name. Otherwise, use the [SfSymbolsName] property to get the possibly remapped symbol.
See: https://developer.apple.com/documentation/GameController/GCControllerElement/unmappedSfSymbolsName
type GCControllerElementClass ¶
type GCControllerElementClass struct {
// contains filtered or unexported fields
}
func GetGCControllerElementClass ¶
func GetGCControllerElementClass() GCControllerElementClass
GetGCControllerElementClass returns the class object for GCControllerElement.
func (GCControllerElementClass) Alloc ¶
func (gc GCControllerElementClass) Alloc() GCControllerElement
Alloc allocates memory for a new instance of the class.
func (GCControllerElementClass) Class ¶
func (gc GCControllerElementClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type GCControllerInputState ¶
type GCControllerInputState struct {
objectivec.Object
}
A class that represents an input state for gamepads and arcade sticks.
Overview ¶
This class implements the GCDevicePhysicalInputState protocol for gamepads and arcade sticks. Instances of this class represent the state of the controller’s inputs at a moment in time, which can be the current time.
See: https://developer.apple.com/documentation/GameController/GCControllerInputState
func GCControllerInputStateFromID ¶
func GCControllerInputStateFromID(id objc.ID) GCControllerInputState
GCControllerInputStateFromID constructs a GCControllerInputState from an objc.ID.
A class that represents an input state for gamepads and arcade sticks.
func NewGCControllerInputState ¶
func NewGCControllerInputState() GCControllerInputState
NewGCControllerInputState creates a new GCControllerInputState instance.
func (GCControllerInputState) Autorelease ¶
func (g GCControllerInputState) Autorelease() GCControllerInputState
Autorelease adds the receiver to the current autorelease pool.
func (GCControllerInputState) Device ¶
func (g GCControllerInputState) Device() GCDevice
The physical device that this profile represents.
See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/device
func (GCControllerInputState) Init ¶
func (g GCControllerInputState) Init() GCControllerInputState
Init initializes the instance.
func (GCControllerInputState) Input ¶
func (g GCControllerInputState) Input() IGCControllerLiveInput
The input profile for the controller.
See: https://developer.apple.com/documentation/gamecontroller/gccontroller/input
func (GCControllerInputState) LastEventLatency ¶
func (g GCControllerInputState) LastEventLatency() float64
The time in seconds between the last event and the current time.
Discussion ¶
Use this property as a minimum latency value that may not include latency that accrues on the device or when it transmits the event. If the host goes to sleep between when the event occurs and when you get this property, the value may not be accurate.
See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/lastEventLatency
func (GCControllerInputState) LastEventTimestamp ¶
func (g GCControllerInputState) LastEventTimestamp() float64
The time of the most recent event.
Discussion ¶
This property isn’t relative to any specific date and time. To determine the time between events, subtract a previous value of this property from the current value. You can also compare [LastEventTimestamp] properties of two different devices to determine which event occurs first.
func (GCControllerInputState) ObjectForKeyedSubscript ¶
func (g GCControllerInputState) ObjectForKeyedSubscript(key string) GCPhysicalInputElement
Returns the element that the key specifies.
key: A key that identifies an element.
Return Value ¶
The element that matches the key.
See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/subscript(_:)
func (GCControllerInputState) SetInput ¶
func (g GCControllerInputState) SetInput(value IGCControllerLiveInput)
type GCControllerInputStateClass ¶
type GCControllerInputStateClass struct {
// contains filtered or unexported fields
}
func GetGCControllerInputStateClass ¶
func GetGCControllerInputStateClass() GCControllerInputStateClass
GetGCControllerInputStateClass returns the class object for GCControllerInputState.
func (GCControllerInputStateClass) Alloc ¶
func (gc GCControllerInputStateClass) Alloc() GCControllerInputState
Alloc allocates memory for a new instance of the class.
func (GCControllerInputStateClass) Class ¶
func (gc GCControllerInputStateClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type GCControllerLiveInput ¶
type GCControllerLiveInput struct {
GCControllerInputState
}
The input profile for a controller.
Overview ¶
Instances of GCControllerLiveInput represent the current input state of a controller. You can save snapshots of the input state and receive callbacks when the input state changes. You can also get the elements of the controller and their current input values from GCControllerLiveInput instances.
Use the GCControllerLiveInput.Capture method to save a copy of the current input state. If you want Game Controller to buffer snapshots of the input states for you, use the GCControllerLiveInput.InputStateQueueDepth property to set the buffer’s queue depth to a value other than `0`. Then use the GCControllerLiveInput.NextInputState method to get the snapshots when you’re ready to process input.
Handling device input ¶
- GCControllerLiveInput.NextInputState: Returns the next device input state from the queue.
- GCControllerLiveInput.Capture: Returns a snapshot of the physical device inputs.
Remapping controls ¶
- GCControllerLiveInput.UnmappedInput: The live input of a controller without any system-level remapping of the controls.
See: https://developer.apple.com/documentation/GameController/GCControllerLiveInput
func GCControllerLiveInputFromID ¶
func GCControllerLiveInputFromID(id objc.ID) GCControllerLiveInput
GCControllerLiveInputFromID constructs a GCControllerLiveInput from an objc.ID.
The input profile for a controller.
func NewGCControllerLiveInput ¶
func NewGCControllerLiveInput() GCControllerLiveInput
NewGCControllerLiveInput creates a new GCControllerLiveInput instance.
func (GCControllerLiveInput) Autorelease ¶
func (g GCControllerLiveInput) Autorelease() GCControllerLiveInput
Autorelease adds the receiver to the current autorelease pool.
func (GCControllerLiveInput) Capture ¶
func (g GCControllerLiveInput) Capture() IGCControllerInputState
Returns a snapshot of the physical device inputs.
Return Value ¶
A new instance containing the current state of the physical device input.
See: https://developer.apple.com/documentation/GameController/GCControllerLiveInput/capture()
func (GCControllerLiveInput) ElementValueDidChangeHandler ¶
func (g GCControllerLiveInput) ElementValueDidChangeHandler() VoidHandler
A block that the profile calls when an element’s value changes.
Discussion ¶
Use this property to get the latest state of the element. If multiple elements change, Game Controller invokes this block for each element that changes. The block’s parameters are:
element: The element whose value changes.
func (GCControllerLiveInput) Init ¶
func (g GCControllerLiveInput) Init() GCControllerLiveInput
Init initializes the instance.
func (GCControllerLiveInput) InputStateAvailableHandler ¶
func (g GCControllerLiveInput) InputStateAvailableHandler() GCDevicePhysicalInputHandler
The block that the profile calls when Game Controller adds an input state to the queue.
Discussion ¶
Set this property to track every element value change, not just the current value. When Game Controller invokes the handler, invoke the [NextInputState] method repeatedly to get all the buffered changes until the queue is empty.
To get just the current element value, use the [ElementValueDidChangeHandler] property instead.
func (GCControllerLiveInput) InputStateQueueDepth ¶
func (g GCControllerLiveInput) InputStateQueueDepth() int
The maximum number of input values that the queue stores.
See: https://developer.apple.com/documentation/gamecontroller/gcdevicephysicalinput/inputstatequeuedepth
func (GCControllerLiveInput) NextInputState ¶
func (g GCControllerLiveInput) NextInputState() IGCControllerInputState
Returns the next device input state from the queue.
Return Value ¶
The next input state in the queue or `nil` if the queue is empty.
See: https://developer.apple.com/documentation/GameController/GCControllerLiveInput/nextInputState()
func (GCControllerLiveInput) Queue ¶
func (g GCControllerLiveInput) Queue() dispatch.Queue
The dispatch queue that the system uses for callbacks.
Discussion ¶
Objects that conform to the GCDevicePhysicalInput protocol dispatch callbacks on the device’s [HandlerQueue] property by default. If you want to use a different dispatch queue, set this property to the preferred queue before you set callbacks.
See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInput/queue
func (GCControllerLiveInput) SetElementValueDidChangeHandler ¶
func (g GCControllerLiveInput) SetElementValueDidChangeHandler(value VoidHandler)
func (GCControllerLiveInput) SetInputStateAvailableHandler ¶
func (g GCControllerLiveInput) SetInputStateAvailableHandler(value GCDevicePhysicalInputHandler)
func (GCControllerLiveInput) SetInputStateQueueDepth ¶
func (g GCControllerLiveInput) SetInputStateQueueDepth(value int)
func (GCControllerLiveInput) SetQueue ¶
func (g GCControllerLiveInput) SetQueue(value dispatch.Queue)
func (GCControllerLiveInput) UnmappedInput ¶
func (g GCControllerLiveInput) UnmappedInput() IGCControllerLiveInput
The live input of a controller without any system-level remapping of the controls.
Discussion ¶
Players should use the system game controller settings to remap controls. If you implement your own controller remapping feature, use this property to access the controller’s physical input without remapping applied.
See: https://developer.apple.com/documentation/GameController/GCControllerLiveInput/unmapped
type GCControllerLiveInputClass ¶
type GCControllerLiveInputClass struct {
// contains filtered or unexported fields
}
func GetGCControllerLiveInputClass ¶
func GetGCControllerLiveInputClass() GCControllerLiveInputClass
GetGCControllerLiveInputClass returns the class object for GCControllerLiveInput.
func (GCControllerLiveInputClass) Alloc ¶
func (gc GCControllerLiveInputClass) Alloc() GCControllerLiveInput
Alloc allocates memory for a new instance of the class.
func (GCControllerLiveInputClass) Class ¶
func (gc GCControllerLiveInputClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type GCControllerPlayerIndex ¶
type GCControllerPlayerIndex int
See: https://developer.apple.com/documentation/GameController/GCControllerPlayerIndex
const ( // GCControllerPlayerIndex1: Player one is using the controller. GCControllerPlayerIndex1 GCControllerPlayerIndex = 0 // GCControllerPlayerIndex2: Player two is using the controller. GCControllerPlayerIndex2 GCControllerPlayerIndex = 1 // GCControllerPlayerIndex3: Player three is using the controller. GCControllerPlayerIndex3 GCControllerPlayerIndex = 2 // GCControllerPlayerIndex4: Player four is using the controller. GCControllerPlayerIndex4 GCControllerPlayerIndex = 3 // GCControllerPlayerIndexUnset: The default index for a player on a controller. GCControllerPlayerIndexUnset GCControllerPlayerIndex = -1 )
func (GCControllerPlayerIndex) String ¶
func (e GCControllerPlayerIndex) String() string
type GCControllerTouchpad ¶
type GCControllerTouchpad struct {
GCControllerElement
}
A control element that represents a touch event on a touchpad.
Overview ¶
A GCControllerTouchpad object provides the state of the touches and presses on a touchpad. This is a compound element with button and directional pad subelements.
Getting the subelements ¶
- GCControllerTouchpad.TouchSurface: The element that represents the state of the user’s touch on the surface of the touchpad.
- GCControllerTouchpad.Button: The element that represents the button component on the touchpad.
Accessing the input values ¶
- GCControllerTouchpad.TouchState: The state of the user’s touch on the surface of the touchpad.
- GCControllerTouchpad.ReportsAbsoluteTouchSurfaceValues: A Boolean value that determines whether the touch values are absolute or relative.
- GCControllerTouchpad.SetReportsAbsoluteTouchSurfaceValues
Getting change information ¶
- GCControllerTouchpad.TouchDown: The block that the element calls when the user begins touching the touchpad.
- GCControllerTouchpad.SetTouchDown
- GCControllerTouchpad.TouchMoved: The block that the element calls when the user continues touching the touchpad, not when the user begins or ends touching the touchpad.
- GCControllerTouchpad.SetTouchMoved
- GCControllerTouchpad.TouchUp: The block that the element calls when the user finishes touching the touchpad.
- GCControllerTouchpad.SetTouchUp
Setting snapshot values ¶
- GCControllerTouchpad.SetValueForXAxisYAxisTouchDownButtonValue: Sets the input values of a snapshot of a touchpad.
See: https://developer.apple.com/documentation/GameController/GCControllerTouchpad
func GCControllerTouchpadFromID ¶
func GCControllerTouchpadFromID(id objc.ID) GCControllerTouchpad
GCControllerTouchpadFromID constructs a GCControllerTouchpad from an objc.ID.
A control element that represents a touch event on a touchpad.
func NewGCControllerTouchpad ¶
func NewGCControllerTouchpad() GCControllerTouchpad
NewGCControllerTouchpad creates a new GCControllerTouchpad instance.
func (GCControllerTouchpad) Autorelease ¶
func (g GCControllerTouchpad) Autorelease() GCControllerTouchpad
Autorelease adds the receiver to the current autorelease pool.
func (GCControllerTouchpad) Button ¶
func (g GCControllerTouchpad) Button() IGCControllerButtonInput
The element that represents the button component on the touchpad.
See: https://developer.apple.com/documentation/GameController/GCControllerTouchpad/button
func (GCControllerTouchpad) Init ¶
func (g GCControllerTouchpad) Init() GCControllerTouchpad
Init initializes the instance.
func (GCControllerTouchpad) ReportsAbsoluteTouchSurfaceValues ¶
func (g GCControllerTouchpad) ReportsAbsoluteTouchSurfaceValues() bool
A Boolean value that determines whether the touch values are absolute or relative.
Discussion ¶
If this property is true, the touch values are absolute on the surface of the touchpad. If this property is false, the touch values are relative to the first touch on a virtual directional pad. The default value for this property is true.
func (GCControllerTouchpad) SetReportsAbsoluteTouchSurfaceValues ¶
func (g GCControllerTouchpad) SetReportsAbsoluteTouchSurfaceValues(value bool)
func (GCControllerTouchpad) SetTouchDown ¶
func (g GCControllerTouchpad) SetTouchDown(value GCControllerTouchpadHandler)
func (GCControllerTouchpad) SetTouchMoved ¶
func (g GCControllerTouchpad) SetTouchMoved(value GCControllerTouchpadHandler)
func (GCControllerTouchpad) SetTouchUp ¶
func (g GCControllerTouchpad) SetTouchUp(value GCControllerTouchpadHandler)
func (GCControllerTouchpad) SetValueForXAxisYAxisTouchDownButtonValue ¶
func (g GCControllerTouchpad) SetValueForXAxisYAxisTouchDownButtonValue(xAxis float32, yAxis float32, touchDown bool, buttonValue float32)
Sets the input values of a snapshot of a touchpad.
xAxis: A normalized value of the x-axis ranging from `-1` to `1`.
yAxis: A normalized value of the y-axis ranging from `-1` to `1`.
touchDown: A Boolean value that indicates whether the user starts touching the surface. If true, the user is touching the surface; otherwise, the user isn’t.
buttonValue: A normalized number between `0.0` (minimum) and `1.0` (maximum) that represents the level of pressure the user applies to the button.
Discussion ¶
This method does nothing if the associated controller isn’t a snapshot (its [Snapshot] property is false`)`.
func (GCControllerTouchpad) TouchDown ¶
func (g GCControllerTouchpad) TouchDown() GCControllerTouchpadHandler
The block that the element calls when the user begins touching the touchpad.
See: https://developer.apple.com/documentation/GameController/GCControllerTouchpad/touchDown
func (GCControllerTouchpad) TouchMoved ¶
func (g GCControllerTouchpad) TouchMoved() GCControllerTouchpadHandler
The block that the element calls when the user continues touching the touchpad, not when the user begins or ends touching the touchpad.
See: https://developer.apple.com/documentation/GameController/GCControllerTouchpad/touchMoved
func (GCControllerTouchpad) TouchState ¶
func (g GCControllerTouchpad) TouchState() GCTouchState
The state of the user’s touch on the surface of the touchpad.
func (GCControllerTouchpad) TouchSurface ¶
func (g GCControllerTouchpad) TouchSurface() IGCControllerDirectionPad
The element that represents the state of the user’s touch on the surface of the touchpad.
Discussion ¶
This element provides the recent or last touch positions on the two axes. Use the [TouchState] property to determine whether the user is currently touching the surface.
See: https://developer.apple.com/documentation/GameController/GCControllerTouchpad/touchSurface
func (GCControllerTouchpad) TouchUp ¶
func (g GCControllerTouchpad) TouchUp() GCControllerTouchpadHandler
The block that the element calls when the user finishes touching the touchpad.
Discussion ¶
The element invokes this handler when the user removes their fingers from the touchpad.
See: https://developer.apple.com/documentation/GameController/GCControllerTouchpad/touchUp
type GCControllerTouchpadClass ¶
type GCControllerTouchpadClass struct {
// contains filtered or unexported fields
}
func GetGCControllerTouchpadClass ¶
func GetGCControllerTouchpadClass() GCControllerTouchpadClass
GetGCControllerTouchpadClass returns the class object for GCControllerTouchpad.
func (GCControllerTouchpadClass) Alloc ¶
func (gc GCControllerTouchpadClass) Alloc() GCControllerTouchpad
Alloc allocates memory for a new instance of the class.
func (GCControllerTouchpadClass) Class ¶
func (gc GCControllerTouchpadClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type GCControllerTouchpadHandler ¶
type GCControllerTouchpadHandler = func(GCControllerTouchpad, float32, float32, float32, bool)
GCControllerTouchpadHandler is the signature for the block that executes when the user interacts with the touchpad.
See: https://developer.apple.com/documentation/GameController/GCControllerTouchpadHandler
type GCDevice ¶
type GCDevice interface {
objectivec.IObject
// The manufacturer-provided name for the device, or the user’s name for the device.
//
// See: https://developer.apple.com/documentation/GameController/GCDevice/vendorName
VendorName() string
// The product category that identifies the type of controller.
//
// See: https://developer.apple.com/documentation/GameController/GCDevice/productCategory
ProductCategory() string
// The dispatch queue that the framework uses to call element value change handlers.
//
// See: https://developer.apple.com/documentation/GameController/GCDevice/handlerQueue
HandlerQueue() dispatch.Queue
// The device’s physical input profile, such as a controller’s extended gamepad.
//
// See: https://developer.apple.com/documentation/GameController/GCDevice/physicalInputProfile
PhysicalInputProfile() IGCPhysicalInputProfile
// The dispatch queue that the framework uses to call element value change handlers.
//
// See: https://developer.apple.com/documentation/GameController/GCDevice/handlerQueue
SetHandlerQueue(value dispatch.Queue)
}
A protocol that defines a common interface for game input devices.
See: https://developer.apple.com/documentation/GameController/GCDevice
type GCDeviceBattery ¶
type GCDeviceBattery struct {
objectivec.Object
}
The charge level and state of a device’s battery.
Overview ¶
Use this class to display the state of a device’s battery to a player.
Getting the battery level and state ¶
- GCDeviceBattery.BatteryLevel: The charge level of a device’s battery.
- GCDeviceBattery.BatteryState: The state of a device’s battery.
See: https://developer.apple.com/documentation/GameController/GCDeviceBattery
func GCDeviceBatteryFromID ¶
func GCDeviceBatteryFromID(id objc.ID) GCDeviceBattery
GCDeviceBatteryFromID constructs a GCDeviceBattery from an objc.ID.
The charge level and state of a device’s battery.
func NewGCDeviceBattery ¶
func NewGCDeviceBattery() GCDeviceBattery
NewGCDeviceBattery creates a new GCDeviceBattery instance.
func (GCDeviceBattery) Autorelease ¶
func (g GCDeviceBattery) Autorelease() GCDeviceBattery
Autorelease adds the receiver to the current autorelease pool.
func (GCDeviceBattery) BatteryLevel ¶
func (g GCDeviceBattery) BatteryLevel() float32
The charge level of a device’s battery.
Discussion ¶
The battery level is a percentage ranging from `0.0` (fully discharged) to `1.0` (100% charged). The default value for this property is `0.0`.
See: https://developer.apple.com/documentation/GameController/GCDeviceBattery/batteryLevel
func (GCDeviceBattery) BatteryState ¶
func (g GCDeviceBattery) BatteryState() GCDeviceBatteryState
The state of a device’s battery.
See: https://developer.apple.com/documentation/GameController/GCDeviceBattery/batteryState
func (GCDeviceBattery) Init ¶
func (g GCDeviceBattery) Init() GCDeviceBattery
Init initializes the instance.
type GCDeviceBatteryClass ¶
type GCDeviceBatteryClass struct {
// contains filtered or unexported fields
}
func GetGCDeviceBatteryClass ¶
func GetGCDeviceBatteryClass() GCDeviceBatteryClass
GetGCDeviceBatteryClass returns the class object for GCDeviceBattery.
func (GCDeviceBatteryClass) Alloc ¶
func (gc GCDeviceBatteryClass) Alloc() GCDeviceBattery
Alloc allocates memory for a new instance of the class.
func (GCDeviceBatteryClass) Class ¶
func (gc GCDeviceBatteryClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type GCDeviceBatteryState ¶
type GCDeviceBatteryState int
See: https://developer.apple.com/documentation/GameController/GCDeviceBattery/State
const ( // GCDeviceBatteryStateCharging: The device’s battery has power and is charging, but isn’t fully charged. GCDeviceBatteryStateCharging GCDeviceBatteryState = 1 // GCDeviceBatteryStateDischarging: The device’s battery is discharging. GCDeviceBatteryStateDischarging GCDeviceBatteryState = 0 // GCDeviceBatteryStateFull: The device’s battery has power and is fully charged. GCDeviceBatteryStateFull GCDeviceBatteryState = 2 // GCDeviceBatteryStateUnknown: The state of the device’s battery is unknown. GCDeviceBatteryStateUnknown GCDeviceBatteryState = -1 )
func (GCDeviceBatteryState) String ¶
func (e GCDeviceBatteryState) String() string
type GCDeviceCursor ¶
type GCDeviceCursor struct {
GCControllerDirectionPad
}
A control element for the cursor used as a directional pad.
Overview ¶
This controller element allows you to use the cursor as a directional pad with the values of the [GCDeviceCursor.XAxis] and [GCDeviceCursor.YAxis] elements scaled to the width and height of the screen, not ranging from `-1` to `1`.
See: https://developer.apple.com/documentation/GameController/GCDeviceCursor
func GCDeviceCursorFromID ¶
func GCDeviceCursorFromID(id objc.ID) GCDeviceCursor
GCDeviceCursorFromID constructs a GCDeviceCursor from an objc.ID.
A control element for the cursor used as a directional pad.
func NewGCDeviceCursor ¶
func NewGCDeviceCursor() GCDeviceCursor
NewGCDeviceCursor creates a new GCDeviceCursor instance.
func (GCDeviceCursor) Autorelease ¶
func (g GCDeviceCursor) Autorelease() GCDeviceCursor
Autorelease adds the receiver to the current autorelease pool.
func (GCDeviceCursor) Init ¶
func (g GCDeviceCursor) Init() GCDeviceCursor
Init initializes the instance.
type GCDeviceCursorClass ¶
type GCDeviceCursorClass struct {
// contains filtered or unexported fields
}
func GetGCDeviceCursorClass ¶
func GetGCDeviceCursorClass() GCDeviceCursorClass
GetGCDeviceCursorClass returns the class object for GCDeviceCursor.
func (GCDeviceCursorClass) Alloc ¶
func (gc GCDeviceCursorClass) Alloc() GCDeviceCursor
Alloc allocates memory for a new instance of the class.
func (GCDeviceCursorClass) Class ¶
func (gc GCDeviceCursorClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type GCDeviceHaptics ¶
type GCDeviceHaptics struct {
objectivec.Object
}
The locations of haptic actuators on a game controller.
Overview ¶
Use this class to create a haptic engine with a specified locality. Any patterns you send to that engine play on the specified actuators.
Creating a haptics engine ¶
- GCDeviceHaptics.CreateEngineWithLocality: Creates a haptics engine with the specified locality.
- GCDeviceHaptics.GCHapticDurationInfinite: An infinite duration for a haptics event.
Getting the localities ¶
- GCDeviceHaptics.SupportedLocalities: The locations of haptic actuators on the device.
See: https://developer.apple.com/documentation/GameController/GCDeviceHaptics
func GCDeviceHapticsFromID ¶
func GCDeviceHapticsFromID(id objc.ID) GCDeviceHaptics
GCDeviceHapticsFromID constructs a GCDeviceHaptics from an objc.ID.
The locations of haptic actuators on a game controller.
func NewGCDeviceHaptics ¶
func NewGCDeviceHaptics() GCDeviceHaptics
NewGCDeviceHaptics creates a new GCDeviceHaptics instance.
func (GCDeviceHaptics) Autorelease ¶
func (g GCDeviceHaptics) Autorelease() GCDeviceHaptics
Autorelease adds the receiver to the current autorelease pool.
func (GCDeviceHaptics) CreateEngineWithLocality ¶
func (g GCDeviceHaptics) CreateEngineWithLocality(locality GCHapticsLocality) unsafe.Pointer
Creates a haptics engine with the specified locality.
locality: The location of the haptics on the controller.
Return Value ¶
A new haptics engine with the specified locality.
Discussion ¶
If you create an engine using the default location, users have the expected haptic experience. For example, the engine uses the handle accuators. If you want to create different experiences, such as using the left handle actuator as a woofer and the right actuator as a tweeter, create one or more engines with different localities.
See: https://developer.apple.com/documentation/GameController/GCDeviceHaptics/createEngine(withLocality:)
func (GCDeviceHaptics) GCHapticDurationInfinite ¶
func (g GCDeviceHaptics) GCHapticDurationInfinite() float32
An infinite duration for a haptics event.
See: https://developer.apple.com/documentation/gamecontroller/gchapticdurationinfinite
func (GCDeviceHaptics) Init ¶
func (g GCDeviceHaptics) Init() GCDeviceHaptics
Init initializes the instance.
func (GCDeviceHaptics) SetSupportsHaptics ¶
func (g GCDeviceHaptics) SetSupportsHaptics(value bool)
func (GCDeviceHaptics) SupportedLocalities ¶
func (g GCDeviceHaptics) SupportedLocalities() foundation.INSSet
The locations of haptic actuators on the device.
See: https://developer.apple.com/documentation/GameController/GCDeviceHaptics/supportedLocalities
func (GCDeviceHaptics) SupportsHaptics ¶
func (g GCDeviceHaptics) SupportsHaptics() bool
A Boolean value that indicates whether the device supports haptic event playback.
See: https://developer.apple.com/documentation/CoreHaptics/CHHapticDeviceCapability/supportsHaptics
type GCDeviceHapticsClass ¶
type GCDeviceHapticsClass struct {
// contains filtered or unexported fields
}
func GetGCDeviceHapticsClass ¶
func GetGCDeviceHapticsClass() GCDeviceHapticsClass
GetGCDeviceHapticsClass returns the class object for GCDeviceHaptics.
func (GCDeviceHapticsClass) Alloc ¶
func (gc GCDeviceHapticsClass) Alloc() GCDeviceHaptics
Alloc allocates memory for a new instance of the class.
func (GCDeviceHapticsClass) Class ¶
func (gc GCDeviceHapticsClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type GCDeviceLight ¶
type GCDeviceLight struct {
objectivec.Object
}
The colored light on a device.
Getting the light’s color ¶
- GCDeviceLight.Color: The color of a device’s light.
- GCDeviceLight.SetColor
See: https://developer.apple.com/documentation/GameController/GCDeviceLight
func GCDeviceLightFromID ¶
func GCDeviceLightFromID(id objc.ID) GCDeviceLight
GCDeviceLightFromID constructs a GCDeviceLight from an objc.ID.
The colored light on a device.
func NewGCDeviceLight ¶
func NewGCDeviceLight() GCDeviceLight
NewGCDeviceLight creates a new GCDeviceLight instance.
func (GCDeviceLight) Autorelease ¶
func (g GCDeviceLight) Autorelease() GCDeviceLight
Autorelease adds the receiver to the current autorelease pool.
func (GCDeviceLight) Color ¶
func (g GCDeviceLight) Color() IGCColor
The color of a device’s light.
See: https://developer.apple.com/documentation/GameController/GCDeviceLight/color
func (GCDeviceLight) Init ¶
func (g GCDeviceLight) Init() GCDeviceLight
Init initializes the instance.
func (GCDeviceLight) SetColor ¶
func (g GCDeviceLight) SetColor(value IGCColor)
type GCDeviceLightClass ¶
type GCDeviceLightClass struct {
// contains filtered or unexported fields
}
func GetGCDeviceLightClass ¶
func GetGCDeviceLightClass() GCDeviceLightClass
GetGCDeviceLightClass returns the class object for GCDeviceLight.
func (GCDeviceLightClass) Alloc ¶
func (gc GCDeviceLightClass) Alloc() GCDeviceLight
Alloc allocates memory for a new instance of the class.
func (GCDeviceLightClass) Class ¶
func (gc GCDeviceLightClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type GCDeviceObject ¶
type GCDeviceObject struct {
objectivec.Object
}
GCDeviceObject wraps an existing Objective-C object that conforms to the GCDevice protocol.
func GCDeviceObjectFromID ¶
func GCDeviceObjectFromID(id objc.ID) GCDeviceObject
GCDeviceObjectFromID constructs a GCDeviceObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (GCDeviceObject) BaseObject ¶
func (o GCDeviceObject) BaseObject() objectivec.Object
func (GCDeviceObject) HandlerQueue ¶
func (o GCDeviceObject) HandlerQueue() dispatch.Queue
The dispatch queue that the framework uses to call element value change handlers.
See: https://developer.apple.com/documentation/GameController/GCDevice/handlerQueue
func (GCDeviceObject) PhysicalInputProfile ¶
func (o GCDeviceObject) PhysicalInputProfile() IGCPhysicalInputProfile
The device’s physical input profile, such as a controller’s extended gamepad.
See: https://developer.apple.com/documentation/GameController/GCDevice/physicalInputProfile
func (GCDeviceObject) ProductCategory ¶
func (o GCDeviceObject) ProductCategory() string
The product category that identifies the type of controller.
See: https://developer.apple.com/documentation/GameController/GCDevice/productCategory
func (GCDeviceObject) SetHandlerQueue ¶
func (o GCDeviceObject) SetHandlerQueue(value dispatch.Queue)
The dispatch queue that the framework uses to call element value change handlers.
Discussion ¶
The default queue is the main queue. Set this property to another queue to asynchronously call value change handlers (see GCControllerAxisInput, GCControllerButtonInput, GCControllerDirectionPad, and GCMotion). For example, if you handle input on another queue, set this property when you first access the input device.
See: https://developer.apple.com/documentation/GameController/GCDevice/handlerQueue
func (GCDeviceObject) VendorName ¶
func (o GCDeviceObject) VendorName() string
The manufacturer-provided name for the device, or the user’s name for the device.
See: https://developer.apple.com/documentation/GameController/GCDevice/vendorName
type GCDevicePhysicalInput ¶
type GCDevicePhysicalInput interface {
objectivec.IObject
GCDevicePhysicalInputState
// The device that the physical input represents.
//
// See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInput/device
Device() GCDevice
// Returns the next input state from the queue.
//
// See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInput/nextInputState()
NextInputState() objectivec.IObject
// The block that the profile calls when Game Controller adds an input state to the queue.
//
// See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInput/inputStateAvailableHandler
InputStateAvailableHandler() func(objc.ID)
// The maximum number of input values that the queue stores.
//
// See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInput/inputStateQueueDepth
InputStateQueueDepth() int
// Returns a snapshot of the physical device inputs.
//
// See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInput/capture()
Capture() GCDevicePhysicalInputState
// A block that the profile calls when an element’s value changes.
//
// See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInput/elementValueDidChangeHandler
ElementValueDidChangeHandler() func(objc.ID)
// The dispatch queue that the system uses for callbacks.
//
// See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInput/queue
Queue() dispatch.Queue
// The maximum number of input values that the queue stores.
//
// See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInput/inputStateQueueDepth
SetInputStateQueueDepth(value int)
// The dispatch queue that the system uses for callbacks.
//
// See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInput/queue
SetQueue(value dispatch.Queue)
}
The common properties and methods for objects that represent the input profile of a device.
See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInput
type GCDevicePhysicalInputElementChange ¶
type GCDevicePhysicalInputElementChange int
See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputElementChange
const ( // GCDevicePhysicalInputElementChanged: There’s a change to the input value. GCDevicePhysicalInputElementChanged GCDevicePhysicalInputElementChange = 1 // GCDevicePhysicalInputElementNoChange: There’s no change to the input value. GCDevicePhysicalInputElementNoChange GCDevicePhysicalInputElementChange = 0 // GCDevicePhysicalInputElementUnknownChange: It’s unknown whether there’s a change to the input value. GCDevicePhysicalInputElementUnknownChange GCDevicePhysicalInputElementChange = -1 )
func (GCDevicePhysicalInputElementChange) String ¶
func (e GCDevicePhysicalInputElementChange) String() string
type GCDevicePhysicalInputHandler ¶
type GCDevicePhysicalInputHandler = func(GCDevicePhysicalInput)
GCDevicePhysicalInputHandler is the signature for a completion handler block.
type GCDevicePhysicalInputObject ¶
type GCDevicePhysicalInputObject struct {
objectivec.Object
}
GCDevicePhysicalInputObject wraps an existing Objective-C object that conforms to the GCDevicePhysicalInput protocol.
func GCDevicePhysicalInputObjectFromID ¶
func GCDevicePhysicalInputObjectFromID(id objc.ID) GCDevicePhysicalInputObject
GCDevicePhysicalInputObjectFromID constructs a GCDevicePhysicalInputObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (GCDevicePhysicalInputObject) BaseObject ¶
func (o GCDevicePhysicalInputObject) BaseObject() objectivec.Object
func (GCDevicePhysicalInputObject) Capture ¶
func (o GCDevicePhysicalInputObject) Capture() GCDevicePhysicalInputState
Returns a snapshot of the physical device inputs.
Return Value ¶
A new instance containing the current state of the physical device input.
See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInput/capture()
func (GCDevicePhysicalInputObject) Device ¶
func (o GCDevicePhysicalInputObject) Device() GCDevice
The device that the physical input represents.
See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInput/device
func (GCDevicePhysicalInputObject) ElementValueDidChangeHandler ¶
func (o GCDevicePhysicalInputObject) ElementValueDidChangeHandler() func(objc.ID)
A block that the profile calls when an element’s value changes.
func (GCDevicePhysicalInputObject) InputStateAvailableHandler ¶
func (o GCDevicePhysicalInputObject) InputStateAvailableHandler() func(objc.ID)
The block that the profile calls when Game Controller adds an input state to the queue.
func (GCDevicePhysicalInputObject) InputStateQueueDepth ¶
func (o GCDevicePhysicalInputObject) InputStateQueueDepth() int
The maximum number of input values that the queue stores.
See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInput/inputStateQueueDepth
func (GCDevicePhysicalInputObject) LastEventLatency ¶
func (o GCDevicePhysicalInputObject) LastEventLatency() float64
The time in seconds between the last event and the current time.
See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/lastEventLatency
func (GCDevicePhysicalInputObject) LastEventTimestamp ¶
func (o GCDevicePhysicalInputObject) LastEventTimestamp() float64
The time of the most recent event.
func (GCDevicePhysicalInputObject) NextInputState ¶
func (o GCDevicePhysicalInputObject) NextInputState() objectivec.IObject
Returns the next input state from the queue.
Return Value ¶
The next input state in the queue or `nil` if the queue is empty.
Discussion ¶
This method removes the next input state from the queue.
See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInput/nextInputState()
func (GCDevicePhysicalInputObject) ObjectForKeyedSubscript ¶
func (o GCDevicePhysicalInputObject) ObjectForKeyedSubscript(key string) GCPhysicalInputElement
Returns the element that the key specifies.
key: A key that identifies an element.
Return Value ¶
The element that matches the key.
See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/subscript(_:)
func (GCDevicePhysicalInputObject) Queue ¶
func (o GCDevicePhysicalInputObject) Queue() dispatch.Queue
The dispatch queue that the system uses for callbacks.
See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInput/queue
func (GCDevicePhysicalInputObject) SetInputStateQueueDepth ¶
func (o GCDevicePhysicalInputObject) SetInputStateQueueDepth(value int)
The maximum number of input values that the queue stores.
Discussion ¶
When the queue reaches this limit, Game Controller starts removing the oldest input states from the queue. The default value for this property is `1` which indicates no buffering.
See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInput/inputStateQueueDepth
func (GCDevicePhysicalInputObject) SetQueue ¶
func (o GCDevicePhysicalInputObject) SetQueue(value dispatch.Queue)
The dispatch queue that the system uses for callbacks.
Discussion ¶
Objects that conform to the GCDevicePhysicalInput protocol dispatch callbacks on the device’s [HandlerQueue] property by default. If you want to use a different dispatch queue, set this property to the preferred queue before you set callbacks.
See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInput/queue
type GCDevicePhysicalInputState ¶
type GCDevicePhysicalInputState interface {
objectivec.IObject
// The physical device that this profile represents.
//
// See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/device
Device() GCDevice
// The time of the most recent event.
//
// See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/lastEventTimestamp
LastEventTimestamp() float64
// The time in seconds between the last event and the current time.
//
// See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/lastEventLatency
LastEventLatency() float64
// Returns the element that the key specifies.
//
// See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/subscript(_:)
ObjectForKeyedSubscript(key string) GCPhysicalInputElement
}
The common properties for physical devices with elements.
See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState
type GCDevicePhysicalInputStateDiff ¶
type GCDevicePhysicalInputStateDiff interface {
objectivec.IObject
// Returns whether the input value of an element changes.
//
// See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputStateDiff/change(for:)
ChangeForElement(element GCPhysicalInputElement) GCDevicePhysicalInputElementChange
}
The common functions for objects that contain the differences between a current and previous input state object.
See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputStateDiff
type GCDevicePhysicalInputStateDiffObject ¶
type GCDevicePhysicalInputStateDiffObject struct {
objectivec.Object
}
GCDevicePhysicalInputStateDiffObject wraps an existing Objective-C object that conforms to the GCDevicePhysicalInputStateDiff protocol.
func GCDevicePhysicalInputStateDiffObjectFromID ¶
func GCDevicePhysicalInputStateDiffObjectFromID(id objc.ID) GCDevicePhysicalInputStateDiffObject
GCDevicePhysicalInputStateDiffObjectFromID constructs a GCDevicePhysicalInputStateDiffObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (GCDevicePhysicalInputStateDiffObject) BaseObject ¶
func (o GCDevicePhysicalInputStateDiffObject) BaseObject() objectivec.Object
func (GCDevicePhysicalInputStateDiffObject) ChangeForElement ¶
func (o GCDevicePhysicalInputStateDiffObject) ChangeForElement(element GCPhysicalInputElement) GCDevicePhysicalInputElementChange
Returns whether the input value of an element changes.
element: The element whose value changes.
Return Value ¶
Description of the change to the element.
See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputStateDiff/change(for:)
type GCDevicePhysicalInputStateObject ¶
type GCDevicePhysicalInputStateObject struct {
objectivec.Object
}
GCDevicePhysicalInputStateObject wraps an existing Objective-C object that conforms to the GCDevicePhysicalInputState protocol.
func GCDevicePhysicalInputStateObjectFromID ¶
func GCDevicePhysicalInputStateObjectFromID(id objc.ID) GCDevicePhysicalInputStateObject
GCDevicePhysicalInputStateObjectFromID constructs a GCDevicePhysicalInputStateObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (GCDevicePhysicalInputStateObject) BaseObject ¶
func (o GCDevicePhysicalInputStateObject) BaseObject() objectivec.Object
func (GCDevicePhysicalInputStateObject) Device ¶
func (o GCDevicePhysicalInputStateObject) Device() GCDevice
The physical device that this profile represents.
See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/device
func (GCDevicePhysicalInputStateObject) LastEventLatency ¶
func (o GCDevicePhysicalInputStateObject) LastEventLatency() float64
The time in seconds between the last event and the current time.
See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/lastEventLatency
func (GCDevicePhysicalInputStateObject) LastEventTimestamp ¶
func (o GCDevicePhysicalInputStateObject) LastEventTimestamp() float64
The time of the most recent event.
func (GCDevicePhysicalInputStateObject) ObjectForKeyedSubscript ¶
func (o GCDevicePhysicalInputStateObject) ObjectForKeyedSubscript(key string) GCPhysicalInputElement
Returns the element that the key specifies.
key: A key that identifies an element.
Return Value ¶
The element that matches the key.
See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/subscript(_:)
type GCDirectionPadElement ¶
type GCDirectionPadElement interface {
objectivec.IObject
GCPhysicalInputElement
// The input object that represents the left button on the directional pad.
//
// See: https://developer.apple.com/documentation/GameController/GCDirectionPadElement/left
Left() objectivec.IObject
// The input object that represents the right button on the directional pad.
//
// See: https://developer.apple.com/documentation/GameController/GCDirectionPadElement/right
Right() objectivec.IObject
// The input object that represents the up button on the directional pad.
//
// See: https://developer.apple.com/documentation/GameController/GCDirectionPadElement/up
Up() objectivec.IObject
// The input object that represents the down button on the directional pad.
//
// See: https://developer.apple.com/documentation/GameController/GCDirectionPadElement/down
Down() objectivec.IObject
// The input object that represents the x-axis on the directional pad.
//
// See: https://developer.apple.com/documentation/GameController/GCDirectionPadElement/xAxis
XAxis() GCAxisInput
// The input object that represents the y-axis on the directional pad.
//
// See: https://developer.apple.com/documentation/GameController/GCDirectionPadElement/yAxis
YAxis() GCAxisInput
// The location of the directional pad represented as a point.
//
// See: https://developer.apple.com/documentation/GameController/GCDirectionPadElement/xyAxes
XyAxes() GCAxis2DInput
}
The common properties of elements that represent directional pads.
See: https://developer.apple.com/documentation/GameController/GCDirectionPadElement
type GCDirectionPadElementName ¶
type GCDirectionPadElementName interface {
objectivec.IObject
GCPhysicalInputElementName
}
The names for directional pad elements.
See: https://developer.apple.com/documentation/GameController/GCDirectionPadElementName-c.protocol
type GCDirectionPadElementNameObject ¶
type GCDirectionPadElementNameObject struct {
objectivec.Object
}
GCDirectionPadElementNameObject wraps an existing Objective-C object that conforms to the GCDirectionPadElementName protocol.
func GCDirectionPadElementNameObjectFromID ¶
func GCDirectionPadElementNameObjectFromID(id objc.ID) GCDirectionPadElementNameObject
GCDirectionPadElementNameObjectFromID constructs a GCDirectionPadElementNameObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (GCDirectionPadElementNameObject) BaseObject ¶
func (o GCDirectionPadElementNameObject) BaseObject() objectivec.Object
type GCDirectionPadElementObject ¶
type GCDirectionPadElementObject struct {
objectivec.Object
}
GCDirectionPadElementObject wraps an existing Objective-C object that conforms to the GCDirectionPadElement protocol.
func GCDirectionPadElementObjectFromID ¶
func GCDirectionPadElementObjectFromID(id objc.ID) GCDirectionPadElementObject
GCDirectionPadElementObjectFromID constructs a GCDirectionPadElementObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (GCDirectionPadElementObject) Aliases ¶
func (o GCDirectionPadElementObject) Aliases() foundation.INSSet
The element’s aliases to use when accessing it with the subscript notation.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElement/aliases
func (GCDirectionPadElementObject) BaseObject ¶
func (o GCDirectionPadElementObject) BaseObject() objectivec.Object
func (GCDirectionPadElementObject) Down ¶
func (o GCDirectionPadElementObject) Down() objectivec.IObject
The input object that represents the down button on the directional pad.
See: https://developer.apple.com/documentation/GameController/GCDirectionPadElement/down
func (GCDirectionPadElementObject) Left ¶
func (o GCDirectionPadElementObject) Left() objectivec.IObject
The input object that represents the left button on the directional pad.
See: https://developer.apple.com/documentation/GameController/GCDirectionPadElement/left
func (GCDirectionPadElementObject) LocalizedName ¶
func (o GCDirectionPadElementObject) LocalizedName() string
The localized name for the element.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElement/localizedName
func (GCDirectionPadElementObject) Right ¶
func (o GCDirectionPadElementObject) Right() objectivec.IObject
The input object that represents the right button on the directional pad.
See: https://developer.apple.com/documentation/GameController/GCDirectionPadElement/right
func (GCDirectionPadElementObject) SfSymbolsName ¶
func (o GCDirectionPadElementObject) SfSymbolsName() string
A system symbol for the element.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElement/sfSymbolsName
func (GCDirectionPadElementObject) Up ¶
func (o GCDirectionPadElementObject) Up() objectivec.IObject
The input object that represents the up button on the directional pad.
See: https://developer.apple.com/documentation/GameController/GCDirectionPadElement/up
func (GCDirectionPadElementObject) XAxis ¶
func (o GCDirectionPadElementObject) XAxis() GCAxisInput
The input object that represents the x-axis on the directional pad.
See: https://developer.apple.com/documentation/GameController/GCDirectionPadElement/xAxis
func (GCDirectionPadElementObject) XyAxes ¶
func (o GCDirectionPadElementObject) XyAxes() GCAxis2DInput
The location of the directional pad represented as a point.
See: https://developer.apple.com/documentation/GameController/GCDirectionPadElement/xyAxes
func (GCDirectionPadElementObject) YAxis ¶
func (o GCDirectionPadElementObject) YAxis() GCAxisInput
The input object that represents the y-axis on the directional pad.
See: https://developer.apple.com/documentation/GameController/GCDirectionPadElement/yAxis
type GCDirectionalGamepad ¶
type GCDirectionalGamepad struct {
GCMicroGamepad
}
A profile that supports only the directional pad, without motion or rotation.
Overview ¶
The directional gamepad profile is similar to a micro gamepad profile except it doesn’t support motion or rotation. The controller’s [GCDirectionalGamepad.Motion] property is `nil` and the inherited [GCDirectionalGamepad.AllowsRotation] property is false.
If you select Micro Gamepad when you add the Game Controllers capability (GCSupportedGameControllers ) to your project, and you also support the GCDirectionalGamepad profile, select Directional Gamepad as well.
If you support the second-generation Siri Remote and later, set the GCSupportsMultipleMicroGamepads key to [YES] in the information property list in your project.
In addition, the directional pad element may report digital or analog values. If the directional pad’s [Analog] property is false, it reports absolute directional pad values (the [GCDirectionalGamepad.ReportsAbsoluteDpadValues] property is true).
See: https://developer.apple.com/documentation/GameController/GCDirectionalGamepad
func GCDirectionalGamepadFromID ¶
func GCDirectionalGamepadFromID(id objc.ID) GCDirectionalGamepad
GCDirectionalGamepadFromID constructs a GCDirectionalGamepad from an objc.ID.
A profile that supports only the directional pad, without motion or rotation.
func NewGCDirectionalGamepad ¶
func NewGCDirectionalGamepad() GCDirectionalGamepad
NewGCDirectionalGamepad creates a new GCDirectionalGamepad instance.
func (GCDirectionalGamepad) Autorelease ¶
func (g GCDirectionalGamepad) Autorelease() GCDirectionalGamepad
Autorelease adds the receiver to the current autorelease pool.
func (GCDirectionalGamepad) Init ¶
func (g GCDirectionalGamepad) Init() GCDirectionalGamepad
Init initializes the instance.
func (GCDirectionalGamepad) IsAnalog ¶
func (g GCDirectionalGamepad) IsAnalog() bool
A Boolean value that indicates whether the element provides analog data.
See: https://developer.apple.com/documentation/gamecontroller/gccontrollerelement/isanalog
func (GCDirectionalGamepad) SetIsAnalog ¶
func (g GCDirectionalGamepad) SetIsAnalog(value bool)
type GCDirectionalGamepadClass ¶
type GCDirectionalGamepadClass struct {
// contains filtered or unexported fields
}
func GetGCDirectionalGamepadClass ¶
func GetGCDirectionalGamepadClass() GCDirectionalGamepadClass
GetGCDirectionalGamepadClass returns the class object for GCDirectionalGamepad.
func (GCDirectionalGamepadClass) Alloc ¶
func (gc GCDirectionalGamepadClass) Alloc() GCDirectionalGamepad
Alloc allocates memory for a new instance of the class.
func (GCDirectionalGamepadClass) Class ¶
func (gc GCDirectionalGamepadClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type GCDualSenseAdaptiveTrigger ¶
type GCDualSenseAdaptiveTrigger struct {
GCControllerButtonInput
}
A class that encapsulates the features of a DualSense adaptive trigger.
Overview ¶
A GCDualSenseAdaptiveTrigger object allows you to specify a dynamic resistance force that the DualSense controller applies when the user pulls the trigger. For example, set the resistance to give the user the feeling of pulling back on a bow string, firing a weapon, or pulling a lever.
Getting the mode ¶
- GCDualSenseAdaptiveTrigger.Mode: The current configuration of the adaptive trigger.
- GCDualSenseAdaptiveTrigger.SetModeOff: Sets the mode to off and stops any trigger effect.
Configuring the trigger ¶
- GCDualSenseAdaptiveTrigger.SetModeFeedbackWithStartPositionResistiveStrength: Sets the mode to provide feedback when the user depresses the trigger at the start position or at a greater value.
- GCDualSenseAdaptiveTrigger.SetModeFeedbackWithResistiveStrengths: Sets the mode to provide feedback with the specified strengths for each possible trigger position.
- GCDualSenseAdaptiveTrigger.SetModeWeaponWithStartPositionEndPositionResistiveStrength: Sets the mode to provide feedback when the user depresses the trigger between the start and the end positions.
- GCDualSenseAdaptiveTrigger.SetModeVibrationWithStartPositionAmplitudeFrequency: Sets the mode to vibrate when the user depresses the trigger at the start position or at a greater value.
- GCDualSenseAdaptiveTrigger.SetModeVibrationWithAmplitudesFrequency: Sets the mode to vibrate with the specified amplitudes for each possible trigger position.
- GCDualSenseAdaptiveTrigger.SetModeSlopeFeedbackWithStartPositionEndPositionStartStrengthEndStrength: Sets the mode to provide feedback when the user tilts the trigger between the start and the end positions.
Getting the arm position ¶
- GCDualSenseAdaptiveTrigger.ArmPosition: The position of the trigger’s arm.
Checking the status ¶
- GCDualSenseAdaptiveTrigger.Status: The current status of the adaptive trigger and whether it’s applying effects.
See: https://developer.apple.com/documentation/GameController/GCDualSenseAdaptiveTrigger
func GCDualSenseAdaptiveTriggerFromID ¶
func GCDualSenseAdaptiveTriggerFromID(id objc.ID) GCDualSenseAdaptiveTrigger
GCDualSenseAdaptiveTriggerFromID constructs a GCDualSenseAdaptiveTrigger from an objc.ID.
A class that encapsulates the features of a DualSense adaptive trigger.
func NewGCDualSenseAdaptiveTrigger ¶
func NewGCDualSenseAdaptiveTrigger() GCDualSenseAdaptiveTrigger
NewGCDualSenseAdaptiveTrigger creates a new GCDualSenseAdaptiveTrigger instance.
func (GCDualSenseAdaptiveTrigger) ArmPosition ¶
func (g GCDualSenseAdaptiveTrigger) ArmPosition() float32
The position of the trigger’s arm.
Discussion ¶
This property represents the value of the stepped mechanical arm inside the trigger and isn’t the same as the trigger’s inherited `value` property. This property ranges between `0` and `1`, where `0` represents the minimum and `1` represents the maximum position.
See: https://developer.apple.com/documentation/GameController/GCDualSenseAdaptiveTrigger/armPosition
func (GCDualSenseAdaptiveTrigger) Autorelease ¶
func (g GCDualSenseAdaptiveTrigger) Autorelease() GCDualSenseAdaptiveTrigger
Autorelease adds the receiver to the current autorelease pool.
func (GCDualSenseAdaptiveTrigger) Init ¶
func (g GCDualSenseAdaptiveTrigger) Init() GCDualSenseAdaptiveTrigger
Init initializes the instance.
func (GCDualSenseAdaptiveTrigger) Mode ¶
func (g GCDualSenseAdaptiveTrigger) Mode() GCDualSenseAdaptiveTriggerMode
The current configuration of the adaptive trigger.
Discussion ¶
There may be a delay updating this property value after you set the mode using one of the set mode methods because setting the mode requires a response from the controller.
func (GCDualSenseAdaptiveTrigger) SetModeFeedbackWithResistiveStrengths ¶
func (g GCDualSenseAdaptiveTrigger) SetModeFeedbackWithResistiveStrengths(positionalResistiveStrengths GCDualSenseAdaptiveTriggerPositionalResistiveStrengths)
Sets the mode to provide feedback with the specified strengths for each possible trigger position.
positionalResistiveStrengths: The resistance values for each possible trigger position.
func (GCDualSenseAdaptiveTrigger) SetModeFeedbackWithStartPositionResistiveStrength ¶
func (g GCDualSenseAdaptiveTrigger) SetModeFeedbackWithStartPositionResistiveStrength(startPosition float32, resistiveStrength float32)
Sets the mode to provide feedback when the user depresses the trigger at the start position or at a greater value.
startPosition: The effect’s start position. A value between `0` and `1` , where `0` is the minimum and `1` is the maximum trigger depression.
resistiveStrength: The strength of the feedback. A value between `0` and `1`, where `0` is the minimum and `1` is the maximum strength.
func (GCDualSenseAdaptiveTrigger) SetModeOff ¶
func (g GCDualSenseAdaptiveTrigger) SetModeOff()
Sets the mode to off and stops any trigger effect.
See: https://developer.apple.com/documentation/GameController/GCDualSenseAdaptiveTrigger/setModeOff()
func (GCDualSenseAdaptiveTrigger) SetModeSlopeFeedbackWithStartPositionEndPositionStartStrengthEndStrength ¶
func (g GCDualSenseAdaptiveTrigger) SetModeSlopeFeedbackWithStartPositionEndPositionStartStrengthEndStrength(startPosition float32, endPosition float32, startStrength float32, endStrength float32)
Sets the mode to provide feedback when the user tilts the trigger between the start and the end positions.
startPosition: The effect’s start position, which is a value between `0` and `1` , where `0` is the minimum and `1` is the maximum trigger tilt.
endPosition: The effect’s end position, which is a value between `0` and `1` , where `0` is the minimum and `1` is the maximum trigger tilt. This value must be greater than `startPosition`.
startStrength: The effect’s start strength, which is a value between `0` and `1`, where `0` is the minimum or off value, and `1` is the maximum strength.
endStrength: The effect’s end strength, which is a value between `0` and `1`, where `0` is the minimum or off value, and `1` is the maximum strength.
func (GCDualSenseAdaptiveTrigger) SetModeVibrationWithAmplitudesFrequency ¶
func (g GCDualSenseAdaptiveTrigger) SetModeVibrationWithAmplitudesFrequency(positionalAmplitudes GCDualSenseAdaptiveTriggerPositionalAmplitudes, frequency float32)
Sets the mode to vibrate with the specified amplitudes for each possible trigger position.
positionalAmplitudes: The amplitudes for each possible trigger position.
frequency: The frequency of the vibration effect, which is a value between `0` and `1`, where `0` is the minimum and `1` is the maximum frequency.
func (GCDualSenseAdaptiveTrigger) SetModeVibrationWithStartPositionAmplitudeFrequency ¶
func (g GCDualSenseAdaptiveTrigger) SetModeVibrationWithStartPositionAmplitudeFrequency(startPosition float32, amplitude float32, frequency float32)
Sets the mode to vibrate when the user depresses the trigger at the start position or at a greater value.
startPosition: The effect’s start position. A value between `0` and `1` , where `0` is the minimum and `1` is the maximum trigger depression.
amplitude: The amplitude of the vibration effect. A value between `0` and `1`, where `0` is the minimum and `1` is the maximum amplitude.
frequency: The frequency of the vibration effect, which is a value between `0` and `1`, where `0` is the minimum and `1` is the maximum frequency.
func (GCDualSenseAdaptiveTrigger) SetModeWeaponWithStartPositionEndPositionResistiveStrength ¶
func (g GCDualSenseAdaptiveTrigger) SetModeWeaponWithStartPositionEndPositionResistiveStrength(startPosition float32, endPosition float32, resistiveStrength float32)
Sets the mode to provide feedback when the user depresses the trigger between the start and the end positions.
startPosition: The effect’s start position. A value between `0` and `1` , where `0` is the minimum and `1` is the maximum trigger depression.
endPosition: The effect’s end position. A value between `0` and `1` , where `0` is the minimum and `1` is the maximum trigger depression. This value must be greater than `startPosition`.
resistiveStrength: The strength of the effect. A value between `0` and `1`, where `0` is the minimum or off value, and `1` is the maximum strength.
Discussion ¶
When the user depresses the trigger beyond the value of the end position, it stops providing feedback, giving the user a sense of release, similar to pulling a weapon trigger.
func (GCDualSenseAdaptiveTrigger) Status ¶
func (g GCDualSenseAdaptiveTrigger) Status() GCDualSenseAdaptiveTriggerStatus
The current status of the adaptive trigger and whether it’s applying effects.
type GCDualSenseAdaptiveTriggerClass ¶
type GCDualSenseAdaptiveTriggerClass struct {
// contains filtered or unexported fields
}
func GetGCDualSenseAdaptiveTriggerClass ¶
func GetGCDualSenseAdaptiveTriggerClass() GCDualSenseAdaptiveTriggerClass
GetGCDualSenseAdaptiveTriggerClass returns the class object for GCDualSenseAdaptiveTrigger.
func (GCDualSenseAdaptiveTriggerClass) Alloc ¶
func (gc GCDualSenseAdaptiveTriggerClass) Alloc() GCDualSenseAdaptiveTrigger
Alloc allocates memory for a new instance of the class.
func (GCDualSenseAdaptiveTriggerClass) Class ¶
func (gc GCDualSenseAdaptiveTriggerClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type GCDualSenseAdaptiveTriggerDiscretePositionCountConstants ¶
type GCDualSenseAdaptiveTriggerDiscretePositionCountConstants uint
const ( // GCDualSenseAdaptiveTriggerDiscretePositionCount: The number of discrete control positions that the DualSense adaptive triggers support. GCDualSenseAdaptiveTriggerDiscretePositionCount GCDualSenseAdaptiveTriggerDiscretePositionCountConstants = 10 )
func (GCDualSenseAdaptiveTriggerDiscretePositionCountConstants) String ¶
func (e GCDualSenseAdaptiveTriggerDiscretePositionCountConstants) String() string
type GCDualSenseAdaptiveTriggerMode ¶
type GCDualSenseAdaptiveTriggerMode int
See: https://developer.apple.com/documentation/GameController/GCDualSenseAdaptiveTrigger/Mode-swift.enum
const ( // GCDualSenseAdaptiveTriggerModeFeedback: Provides feedback when the user depresses the trigger equal to, or greater than, the start position. GCDualSenseAdaptiveTriggerModeFeedback GCDualSenseAdaptiveTriggerMode = 1 // GCDualSenseAdaptiveTriggerModeOff: Provides no adaptive trigger effects. GCDualSenseAdaptiveTriggerModeOff GCDualSenseAdaptiveTriggerMode = 0 // GCDualSenseAdaptiveTriggerModeSlopeFeedback: Provides feedback when the user tilts the trigger between the start and the end positions. GCDualSenseAdaptiveTriggerModeSlopeFeedback GCDualSenseAdaptiveTriggerMode = 4 // GCDualSenseAdaptiveTriggerModeVibration: Vibrates when the user depresses the trigger equal to, or greater than, the start position. GCDualSenseAdaptiveTriggerModeVibration GCDualSenseAdaptiveTriggerMode = 3 // GCDualSenseAdaptiveTriggerModeWeapon: Provides feedback when the user depresses the trigger between the start and the end positions. GCDualSenseAdaptiveTriggerModeWeapon GCDualSenseAdaptiveTriggerMode = 2 )
func (GCDualSenseAdaptiveTriggerMode) String ¶
func (e GCDualSenseAdaptiveTriggerMode) String() string
type GCDualSenseAdaptiveTriggerPositionalAmplitudes ¶
type GCDualSenseAdaptiveTriggerPositionalAmplitudes struct {
Values float32 // The amplitude values for possible trigger positions.
}
GCDualSenseAdaptiveTriggerPositionalAmplitudes - The amplitudes for multiple positions on a trigger.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/GameController/GCDualSenseAdaptiveTrigger/PositionalAmplitudes
type GCDualSenseAdaptiveTriggerPositionalResistiveStrengths ¶
type GCDualSenseAdaptiveTriggerPositionalResistiveStrengths struct {
Values float32 // The resistive strength values for possible trigger positions.
}
GCDualSenseAdaptiveTriggerPositionalResistiveStrengths - The resistive strengths for multiple positions on a trigger.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/GameController/GCDualSenseAdaptiveTrigger/PositionalResistiveStrengths
type GCDualSenseAdaptiveTriggerStatus ¶
type GCDualSenseAdaptiveTriggerStatus int
const ( // GCDualSenseAdaptiveTriggerStatusFeedbackLoadApplied: The trigger is in feedback mode and is applying the resistive load. GCDualSenseAdaptiveTriggerStatusFeedbackLoadApplied GCDualSenseAdaptiveTriggerStatus = 1 // GCDualSenseAdaptiveTriggerStatusFeedbackNoLoad: The trigger is in feedback mode, but isn’t applying the resistive load. GCDualSenseAdaptiveTriggerStatusFeedbackNoLoad GCDualSenseAdaptiveTriggerStatus = 0 // GCDualSenseAdaptiveTriggerStatusSlopeFeedbackApplyingLoad: The trigger is in slope mode, and is applying the resistive load. GCDualSenseAdaptiveTriggerStatusSlopeFeedbackApplyingLoad GCDualSenseAdaptiveTriggerStatus = 8 // GCDualSenseAdaptiveTriggerStatusSlopeFeedbackFinished: The trigger is in slope mode, and stopped applying the resistive load. GCDualSenseAdaptiveTriggerStatusSlopeFeedbackFinished GCDualSenseAdaptiveTriggerStatus = 9 // GCDualSenseAdaptiveTriggerStatusSlopeFeedbackReady: The trigger is in slope mode, but isn’t applying the resistive load. GCDualSenseAdaptiveTriggerStatusSlopeFeedbackReady GCDualSenseAdaptiveTriggerStatus = 7 // GCDualSenseAdaptiveTriggerStatusUnknown: The trigger status is unknown. GCDualSenseAdaptiveTriggerStatusUnknown GCDualSenseAdaptiveTriggerStatus = -1 // GCDualSenseAdaptiveTriggerStatusVibrationIsVibrating: The trigger is in vibration mode and is vibrating. GCDualSenseAdaptiveTriggerStatusVibrationIsVibrating GCDualSenseAdaptiveTriggerStatus = 6 // GCDualSenseAdaptiveTriggerStatusVibrationNotVibrating: The trigger is in vibration mode, but isn’t vibrating. GCDualSenseAdaptiveTriggerStatusVibrationNotVibrating GCDualSenseAdaptiveTriggerStatus = 5 // GCDualSenseAdaptiveTriggerStatusWeaponFired: The trigger is in weapon mode, has fired, and has stopped applying the resistive load. GCDualSenseAdaptiveTriggerStatusWeaponFired GCDualSenseAdaptiveTriggerStatus = 4 // GCDualSenseAdaptiveTriggerStatusWeaponFiring: The trigger is in weapon mode, firing, and is applying the resistive load. GCDualSenseAdaptiveTriggerStatusWeaponFiring GCDualSenseAdaptiveTriggerStatus = 3 // GCDualSenseAdaptiveTriggerStatusWeaponReady: The trigger is in weapon mode and ready to fire, but isn’t applying the resistive load. GCDualSenseAdaptiveTriggerStatusWeaponReady GCDualSenseAdaptiveTriggerStatus = 2 )
func (GCDualSenseAdaptiveTriggerStatus) String ¶
func (e GCDualSenseAdaptiveTriggerStatus) String() string
type GCDualSenseGamepad ¶
type GCDualSenseGamepad struct {
GCExtendedGamepad
}
A controller profile that supported the DualSense controller.
Overview ¶
The DualSense controller profile is similar to a DualShock profile (GCDualShockGamepad), but has adaptive triggers that allow you to specify a dynamic resistance force when the user pulls the trigger. For example, you can emulate the feeling of pulling back a bow string, firing a weapon, or pulling a lever.
This profile also supports motion — that is, the controller’s [GCDualSenseGamepad.Motion] property is non-nil. If you hold the controller in front of you, the direction of the axes are:
- The positive x-axis points to your right. - The positive y-axis points up out of the USB-C port. - The positive z-axis starts at the touchpad and points to you.
Getting button input ¶
- GCDualSenseGamepad.TouchpadButton: The button element on the touchpad of the controller.
Tracking finger locations ¶
- GCDualSenseGamepad.TouchpadPrimary: The location of the player’s primary finger on the touchpad.
- GCDualSenseGamepad.TouchpadSecondary: The location of the player’s secondary finger on the touchpad.
See: https://developer.apple.com/documentation/GameController/GCDualSenseGamepad
func GCDualSenseGamepadFromID ¶
func GCDualSenseGamepadFromID(id objc.ID) GCDualSenseGamepad
GCDualSenseGamepadFromID constructs a GCDualSenseGamepad from an objc.ID.
A controller profile that supported the DualSense controller.
func NewGCDualSenseGamepad ¶
func NewGCDualSenseGamepad() GCDualSenseGamepad
NewGCDualSenseGamepad creates a new GCDualSenseGamepad instance.
func (GCDualSenseGamepad) Autorelease ¶
func (g GCDualSenseGamepad) Autorelease() GCDualSenseGamepad
Autorelease adds the receiver to the current autorelease pool.
func (GCDualSenseGamepad) Init ¶
func (g GCDualSenseGamepad) Init() GCDualSenseGamepad
Init initializes the instance.
func (GCDualSenseGamepad) TouchpadButton ¶
func (g GCDualSenseGamepad) TouchpadButton() IGCControllerButtonInput
The button element on the touchpad of the controller.
See: https://developer.apple.com/documentation/GameController/GCDualSenseGamepad/touchpadButton
func (GCDualSenseGamepad) TouchpadPrimary ¶
func (g GCDualSenseGamepad) TouchpadPrimary() IGCControllerDirectionPad
The location of the player’s primary finger on the touchpad.
See: https://developer.apple.com/documentation/GameController/GCDualSenseGamepad/touchpadPrimary
func (GCDualSenseGamepad) TouchpadSecondary ¶
func (g GCDualSenseGamepad) TouchpadSecondary() IGCControllerDirectionPad
The location of the player’s secondary finger on the touchpad.
See: https://developer.apple.com/documentation/GameController/GCDualSenseGamepad/touchpadSecondary
type GCDualSenseGamepadClass ¶
type GCDualSenseGamepadClass struct {
// contains filtered or unexported fields
}
func GetGCDualSenseGamepadClass ¶
func GetGCDualSenseGamepadClass() GCDualSenseGamepadClass
GetGCDualSenseGamepadClass returns the class object for GCDualSenseGamepad.
func (GCDualSenseGamepadClass) Alloc ¶
func (gc GCDualSenseGamepadClass) Alloc() GCDualSenseGamepad
Alloc allocates memory for a new instance of the class.
func (GCDualSenseGamepadClass) Class ¶
func (gc GCDualSenseGamepadClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type GCDualShockGamepad ¶
type GCDualShockGamepad struct {
GCExtendedGamepad
}
A controller profile that supports the DualShock 4 controller.
Overview ¶
The DualShock 4 controller profile is similar to an extended gamepad (GCExtendedGamepad), but has a touchpad with a button and two-finger tracking.
[media-3830806]
This profile also supports motion — that is, the controller’s [GCDualShockGamepad.Motion] property is non-nil. If you hold the controller in front of you, the direction of the axes are:
- The positive x-axis points to your right. - The positive y-axis points up. - The positive z-axis starts at the touchpad and points to you.
[media-3856422]
Getting button input ¶
- GCDualShockGamepad.TouchpadButton: The button element on the touchpad of the controller.
Tracking finger locations ¶
- GCDualShockGamepad.TouchpadPrimary: The location of the player’s primary finger on the touchpad.
- GCDualShockGamepad.TouchpadSecondary: The location of the player’s secondary finger on the touchpad.
See: https://developer.apple.com/documentation/GameController/GCDualShockGamepad
func GCDualShockGamepadFromID ¶
func GCDualShockGamepadFromID(id objc.ID) GCDualShockGamepad
GCDualShockGamepadFromID constructs a GCDualShockGamepad from an objc.ID.
A controller profile that supports the DualShock 4 controller.
func NewGCDualShockGamepad ¶
func NewGCDualShockGamepad() GCDualShockGamepad
NewGCDualShockGamepad creates a new GCDualShockGamepad instance.
func (GCDualShockGamepad) Autorelease ¶
func (g GCDualShockGamepad) Autorelease() GCDualShockGamepad
Autorelease adds the receiver to the current autorelease pool.
func (GCDualShockGamepad) Init ¶
func (g GCDualShockGamepad) Init() GCDualShockGamepad
Init initializes the instance.
func (GCDualShockGamepad) TouchpadButton ¶
func (g GCDualShockGamepad) TouchpadButton() IGCControllerButtonInput
The button element on the touchpad of the controller.
See: https://developer.apple.com/documentation/GameController/GCDualShockGamepad/touchpadButton
func (GCDualShockGamepad) TouchpadPrimary ¶
func (g GCDualShockGamepad) TouchpadPrimary() IGCControllerDirectionPad
The location of the player’s primary finger on the touchpad.
See: https://developer.apple.com/documentation/GameController/GCDualShockGamepad/touchpadPrimary
func (GCDualShockGamepad) TouchpadSecondary ¶
func (g GCDualShockGamepad) TouchpadSecondary() IGCControllerDirectionPad
The location of the player’s secondary finger on the touchpad.
See: https://developer.apple.com/documentation/GameController/GCDualShockGamepad/touchpadSecondary
type GCDualShockGamepadClass ¶
type GCDualShockGamepadClass struct {
// contains filtered or unexported fields
}
func GetGCDualShockGamepadClass ¶
func GetGCDualShockGamepadClass() GCDualShockGamepadClass
GetGCDualShockGamepadClass returns the class object for GCDualShockGamepad.
func (GCDualShockGamepadClass) Alloc ¶
func (gc GCDualShockGamepadClass) Alloc() GCDualShockGamepad
Alloc allocates memory for a new instance of the class.
func (GCDualShockGamepadClass) Class ¶
func (gc GCDualShockGamepadClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type GCEulerAngles ¶
type GCEulerAngles struct {
Pitch float64 // The pitch of the controller in radians.
Yaw float64 // The yaw of the device in radians.
Roll float64 // The roll of the controller in radians.
}
GCEulerAngles - A structure that specifies the controller’s attitude as a series of rotations around the x, y, and z axes.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/GameController/GCEulerAngles
type GCEventViewController ¶
type GCEventViewController struct {
appkit.NSViewController
}
A view controller that delivers input either from the responder chain to views, or from game controllers to profiles.
Overview ¶
On systems, such as tvOS, where the player uses the game controller to both navigate the system interface and play your game, use a GCEventViewController object as the root view controller to selectively receive input directly from the game controller. You can’t simultaneously process input through the responder chain and Game Controller input elements.
By default the system delivers input events to your app using the responder chain. To get the input values through the game controller objects, set a GCEventViewController object as the root view controller. The view controller delivers the input for its views and their subviews to the game controller’s profile. To switch back to the responder chain, set the view controller’s GCEventViewController.ControllerUserInteractionEnabled property to true.
Delivering game controller inputs ¶
- GCEventViewController.ControllerUserInteractionEnabled: A Boolean value that indicates whether the system delivers game controller input to profile objects or to views using the responder chain.
- GCEventViewController.SetControllerUserInteractionEnabled
See: https://developer.apple.com/documentation/GameController/GCEventViewController
func GCEventViewControllerFromID ¶
func GCEventViewControllerFromID(id objc.ID) GCEventViewController
GCEventViewControllerFromID constructs a GCEventViewController from an objc.ID.
A view controller that delivers input either from the responder chain to views, or from game controllers to profiles.
func NewGCEventViewController ¶
func NewGCEventViewController() GCEventViewController
NewGCEventViewController creates a new GCEventViewController instance.
func (GCEventViewController) Autorelease ¶
func (g GCEventViewController) Autorelease() GCEventViewController
Autorelease adds the receiver to the current autorelease pool.
func (GCEventViewController) ControllerUserInteractionEnabled ¶
func (g GCEventViewController) ControllerUserInteractionEnabled() bool
A Boolean value that indicates whether the system delivers game controller input to profile objects or to views using the responder chain.
Discussion ¶
If this property is false, when the view controller’s view or its subviews are the first responder, the system delivers the game controller input to the profile objects. If this property is true, the system generates input events and delivers them through the responder chain.
func (GCEventViewController) Init ¶
func (g GCEventViewController) Init() GCEventViewController
Init initializes the instance.
func (GCEventViewController) SetControllerUserInteractionEnabled ¶
func (g GCEventViewController) SetControllerUserInteractionEnabled(value bool)
type GCEventViewControllerClass ¶
type GCEventViewControllerClass struct {
// contains filtered or unexported fields
}
func GetGCEventViewControllerClass ¶
func GetGCEventViewControllerClass() GCEventViewControllerClass
GetGCEventViewControllerClass returns the class object for GCEventViewController.
func (GCEventViewControllerClass) Alloc ¶
func (gc GCEventViewControllerClass) Alloc() GCEventViewController
Alloc allocates memory for a new instance of the class.
func (GCEventViewControllerClass) Class ¶
func (gc GCEventViewControllerClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type GCExtendedGamepad ¶
type GCExtendedGamepad struct {
GCPhysicalInputProfile
}
A controller profile that supports the extended set of gamepad controls.
Overview ¶
The extended gamepad controller profile represents a physical or virtual controller with the following input elements:
- Two shoulder buttons - Two trigger buttons - Four face buttons in a diamond pattern - One directional pad - Two thumbsticks with optional thumbstick buttons - Optional Home and Options buttons - A Menu button
[media-3850406]
If a GCController object supports this type of profile, get the input values of the elements from the controller’s [GCExtendedGamepad.ExtendedGamepad] property or use the profile’s GCExtendedGamepad.ValueChangedHandler method to receive a callback when the input values change. Alternatively, use the saveSnapshot() method to capture the input values at a moment in time.
If the controller’s [GCExtendedGamepad.ExtendedGamepad] property is `nil`, the controller doesn’t support this type of profile. See GCController for other profiles you can use.
Getting the controller ¶
- GCExtendedGamepad.Controller: The controller for the profile.
Getting change information ¶
- GCExtendedGamepad.ValueChangedHandler: The block that the profile calls when an element’s value changes.
- GCExtendedGamepad.SetValueChangedHandler
Getting shoulder button inputs ¶
- GCExtendedGamepad.LeftShoulder: The controller’s left shoulder button element.
- GCExtendedGamepad.RightShoulder: The controller’s right shoulder button element.
Getting trigger inputs ¶
- GCExtendedGamepad.LeftTrigger: The controller’s left trigger element.
- GCExtendedGamepad.RightTrigger: The controller’s right trigger element.
Getting face button inputs ¶
- GCExtendedGamepad.ButtonMenu: The primary menu button element that players use to enter the main menu and pause the game.
- GCExtendedGamepad.ButtonOptions: The controller’s secondary menu button element.
- GCExtendedGamepad.ButtonHome: The main menu button element that players use to enter the secondary menu and pause the game.
- GCExtendedGamepad.ButtonA: The bottom face button that uses or another indicator as its label.
- GCExtendedGamepad.ButtonB: The right face button that uses or another indicator as its label.
- GCExtendedGamepad.ButtonX: The left face button that uses or another indicator as its label.
- GCExtendedGamepad.ButtonY: The top face button that uses or another indicator as its label.
Getting directional pad inputs ¶
- GCExtendedGamepad.Dpad: The controller’s directional pad element.
Getting thumbstick and thumbstick button inputs ¶
- GCExtendedGamepad.LeftThumbstick: The controller’s left thumbstick element.
- GCExtendedGamepad.RightThumbstick: The controller’s right thumbstick element.
- GCExtendedGamepad.LeftThumbstickButton: The button on the left thumbstick of the controller.
- GCExtendedGamepad.RightThumbstickButton: The button on the right thumbstick of the controller.
Setting snapshot values ¶
- GCExtendedGamepad.SetStateFromExtendedGamepad: Copies the input values from a specified extended gamepad to a snapshot of an extended gamepad.
See: https://developer.apple.com/documentation/GameController/GCExtendedGamepad
func GCExtendedGamepadFromID ¶
func GCExtendedGamepadFromID(id objc.ID) GCExtendedGamepad
GCExtendedGamepadFromID constructs a GCExtendedGamepad from an objc.ID.
A controller profile that supports the extended set of gamepad controls.
func NewGCExtendedGamepad ¶
func NewGCExtendedGamepad() GCExtendedGamepad
NewGCExtendedGamepad creates a new GCExtendedGamepad instance.
func (GCExtendedGamepad) Autorelease ¶
func (g GCExtendedGamepad) Autorelease() GCExtendedGamepad
Autorelease adds the receiver to the current autorelease pool.
func (GCExtendedGamepad) ButtonA ¶
func (g GCExtendedGamepad) ButtonA() IGCControllerButtonInput
The bottom face button that uses or another indicator as its label.
Discussion ¶
The face buttons in the extended gamepad profile may be either analog or digital buttons.
See: https://developer.apple.com/documentation/GameController/GCExtendedGamepad/buttonA
func (GCExtendedGamepad) ButtonB ¶
func (g GCExtendedGamepad) ButtonB() IGCControllerButtonInput
The right face button that uses or another indicator as its label.
Discussion ¶
The face buttons in the extended gamepad profile may be either analog or digital buttons.
See: https://developer.apple.com/documentation/GameController/GCExtendedGamepad/buttonB
func (GCExtendedGamepad) ButtonHome ¶
func (g GCExtendedGamepad) ButtonHome() IGCControllerButtonInput
The main menu button element that players use to enter the secondary menu and pause the game.
Discussion ¶
If the system doesn’t process the main menu events, it passes the events to your app.
See: https://developer.apple.com/documentation/GameController/GCExtendedGamepad/buttonHome
func (GCExtendedGamepad) ButtonMenu ¶
func (g GCExtendedGamepad) ButtonMenu() IGCControllerButtonInput
The primary menu button element that players use to enter the main menu and pause the game.
See: https://developer.apple.com/documentation/GameController/GCExtendedGamepad/buttonMenu
func (GCExtendedGamepad) ButtonOptions ¶
func (g GCExtendedGamepad) ButtonOptions() IGCControllerButtonInput
The controller’s secondary menu button element.
Discussion ¶
You can use the secondary menu to configure graphics and sound, and to pause the game.
See: https://developer.apple.com/documentation/GameController/GCExtendedGamepad/buttonOptions
func (GCExtendedGamepad) ButtonX ¶
func (g GCExtendedGamepad) ButtonX() IGCControllerButtonInput
The left face button that uses or another indicator as its label.
Discussion ¶
The face buttons in the extended gamepad profile may be either analog or digital buttons.
See: https://developer.apple.com/documentation/GameController/GCExtendedGamepad/buttonX
func (GCExtendedGamepad) ButtonY ¶
func (g GCExtendedGamepad) ButtonY() IGCControllerButtonInput
The top face button that uses or another indicator as its label.
Discussion ¶
The face buttons in the extended gamepad profile may be either analog or digital buttons.
See: https://developer.apple.com/documentation/GameController/GCExtendedGamepad/buttonY
func (GCExtendedGamepad) Controller ¶
func (g GCExtendedGamepad) Controller() IGCController
The controller for the profile.
See: https://developer.apple.com/documentation/GameController/GCExtendedGamepad/controller
func (GCExtendedGamepad) Dpad ¶
func (g GCExtendedGamepad) Dpad() IGCControllerDirectionPad
The controller’s directional pad element.
Discussion ¶
The directional pad in the extended gamepad profile reports analog directional information.
See: https://developer.apple.com/documentation/GameController/GCExtendedGamepad/dpad
func (GCExtendedGamepad) Init ¶
func (g GCExtendedGamepad) Init() GCExtendedGamepad
Init initializes the instance.
func (GCExtendedGamepad) LeftShoulder ¶
func (g GCExtendedGamepad) LeftShoulder() IGCControllerButtonInput
The controller’s left shoulder button element.
Discussion ¶
The shoulder buttons in the extended gamepad profile are analog buttons.
See: https://developer.apple.com/documentation/GameController/GCExtendedGamepad/leftShoulder
func (GCExtendedGamepad) LeftThumbstick ¶
func (g GCExtendedGamepad) LeftThumbstick() IGCControllerDirectionPad
The controller’s left thumbstick element.
Discussion ¶
The thumbsticks in the extended gamepad profile are analog buttons.
See: https://developer.apple.com/documentation/GameController/GCExtendedGamepad/leftThumbstick
func (GCExtendedGamepad) LeftThumbstickButton ¶
func (g GCExtendedGamepad) LeftThumbstickButton() IGCControllerButtonInput
The button on the left thumbstick of the controller.
Discussion ¶
If the thumbstick has a clickable component, this is a digital button.
See: https://developer.apple.com/documentation/GameController/GCExtendedGamepad/leftThumbstickButton
func (GCExtendedGamepad) LeftTrigger ¶
func (g GCExtendedGamepad) LeftTrigger() IGCControllerButtonInput
The controller’s left trigger element.
Discussion ¶
The triggers in the extended gamepad profile are analog buttons.
See: https://developer.apple.com/documentation/GameController/GCExtendedGamepad/leftTrigger
func (GCExtendedGamepad) RightShoulder ¶
func (g GCExtendedGamepad) RightShoulder() IGCControllerButtonInput
The controller’s right shoulder button element.
Discussion ¶
The shoulder buttons in the extended gamepad profile are analog buttons.
See: https://developer.apple.com/documentation/GameController/GCExtendedGamepad/rightShoulder
func (GCExtendedGamepad) RightThumbstick ¶
func (g GCExtendedGamepad) RightThumbstick() IGCControllerDirectionPad
The controller’s right thumbstick element.
Discussion ¶
The thumbsticks in the extended gamepad profile are analog buttons.
See: https://developer.apple.com/documentation/GameController/GCExtendedGamepad/rightThumbstick
func (GCExtendedGamepad) RightThumbstickButton ¶
func (g GCExtendedGamepad) RightThumbstickButton() IGCControllerButtonInput
The button on the right thumbstick of the controller.
Discussion ¶
If the thumbstick has a clickable component, this is a digital button.
See: https://developer.apple.com/documentation/GameController/GCExtendedGamepad/rightThumbstickButton
func (GCExtendedGamepad) RightTrigger ¶
func (g GCExtendedGamepad) RightTrigger() IGCControllerButtonInput
The controller’s right trigger element.
Discussion ¶
The triggers in the extended gamepad profile are analog buttons.
See: https://developer.apple.com/documentation/GameController/GCExtendedGamepad/rightTrigger
func (GCExtendedGamepad) SetStateFromExtendedGamepad ¶
func (g GCExtendedGamepad) SetStateFromExtendedGamepad(extendedGamepad IGCExtendedGamepad)
Copies the input values from a specified extended gamepad to a snapshot of an extended gamepad.
extendedGamepad: The extended gamepad to copy the input values from.
Discussion ¶
If this extended gamepad isn’t a snapshot, this method does nothing. A snapshot is a copy of a controller at a moment in time that has element values you can set.
See: https://developer.apple.com/documentation/GameController/GCExtendedGamepad/setStateFrom(_:)
func (GCExtendedGamepad) SetValueChangedHandler ¶
func (g GCExtendedGamepad) SetValueChangedHandler(value GCExtendedGamepadValueChangedHandler)
func (GCExtendedGamepad) ValueChangedHandler ¶
func (g GCExtendedGamepad) ValueChangedHandler() GCExtendedGamepadValueChangedHandler
The block that the profile calls when an element’s value changes.
Discussion ¶
If multiple elements change values at the same time, the profile calls this block once for each element that changes. If the value of a subelement changes, the profile only calls the block for the containing element.
See: https://developer.apple.com/documentation/GameController/GCExtendedGamepad/valueChangedHandler
type GCExtendedGamepadClass ¶
type GCExtendedGamepadClass struct {
// contains filtered or unexported fields
}
func GetGCExtendedGamepadClass ¶
func GetGCExtendedGamepadClass() GCExtendedGamepadClass
GetGCExtendedGamepadClass returns the class object for GCExtendedGamepad.
func (GCExtendedGamepadClass) Alloc ¶
func (gc GCExtendedGamepadClass) Alloc() GCExtendedGamepad
Alloc allocates memory for a new instance of the class.
func (GCExtendedGamepadClass) Class ¶
func (gc GCExtendedGamepadClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type GCExtendedGamepadSnapShotDataV100 ¶
type GCExtendedGamepadSnapShotDataV100 struct {
ButtonA float32 // The value of the A button.
ButtonB float32 // The value of the B button.
ButtonX float32 // The value of the X button.
ButtonY float32 // The value of the Y button.
DpadX float32 // The value of the horizontal axis of the dpad.
DpadY float32 // The value of the vertical axis of the dpad.
LeftShoulder float32 // The value of the left shoulder button.
LeftThumbstickX float32 // The value of the horizontal axis of the left thumbstick.
LeftThumbstickY float32 // The value of the vertical axis of the left thumbstick.
LeftTrigger float32 // The value of the left trigger.
RightShoulder float32 // The value of the right shoulder button.
RightThumbstickX float32 // The value of the horizontal axis of the right thumbstick.
RightThumbstickY float32 // The value of the vertical axis of the right thumbstick.
RightTrigger float32 // The value of the right trigger.
Size uint16 // The size of the recorded structure, in bytes.
Version uint16 // A value that indicates the version number of the data structure.
}
GCExtendedGamepadSnapShotDataV100 - A structure that holds a snapshot of an extended gamepad controller’s input data.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/GameController/GCExtendedGamepadSnapShotDataV100
type GCExtendedGamepadSnapshotData ¶
type GCExtendedGamepadSnapshotData struct {
ButtonA float32
ButtonB float32
ButtonX float32
ButtonY float32
DpadX float32
DpadY float32
LeftShoulder float32
LeftThumbstickButton bool
LeftThumbstickX float32
LeftThumbstickY float32
LeftTrigger float32
RightShoulder float32
RightThumbstickButton bool
RightThumbstickX float32
RightThumbstickY float32
RightTrigger float32
Size uint16
SupportsClickableThumbsticks bool
Version uint16
}
GCExtendedGamepadSnapshotData
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/GameController/GCExtendedGamepadSnapshotData
type GCExtendedGamepadSnapshotDataVersion ¶
type GCExtendedGamepadSnapshotDataVersion int
See: https://developer.apple.com/documentation/GameController/GCExtendedGamepadSnapshotDataVersion
const ( GCExtendedGamepadSnapshotDataVersion1 GCExtendedGamepadSnapshotDataVersion = 0x100 GCExtendedGamepadSnapshotDataVersion2 GCExtendedGamepadSnapshotDataVersion = 0x101 )
func (GCExtendedGamepadSnapshotDataVersion) String ¶
func (e GCExtendedGamepadSnapshotDataVersion) String() string
type GCExtendedGamepadValueChangedHandler ¶
type GCExtendedGamepadValueChangedHandler = func(GCExtendedGamepad, GCControllerElement)
GCExtendedGamepadValueChangedHandler is the signature for the block that the profile calls when an element’s value changes.
See: https://developer.apple.com/documentation/GameController/GCExtendedGamepadValueChangedHandler
type GCGamepadSnapShotDataV100 ¶
type GCGamepadSnapShotDataV100 struct {
ButtonA float32 // The value of the A button.
ButtonB float32 // The value of the B button.
ButtonX float32 // The value of the X button.
ButtonY float32 // The value of the Y button.
DpadX float32 // The value of the horizontal axis of the dpad.
DpadY float32 // The value of the vertical axis of the dpad.
LeftShoulder float32 // The value of the left shoulder button.
RightShoulder float32 // The value of the right shoulder button.
Size uint16 // The size of the recorded structure, in bytes.
Version uint16 // A value that indicates the version number of the data structure.
}
GCGamepadSnapShotDataV100 - A structure that holds a snapshot of a gamepad controller’s input data.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/GameController/GCGamepadSnapShotDataV100
type GCGamepadValueChangedHandler ¶
type GCGamepadValueChangedHandler = func(*uintptr, GCControllerElement)
GCGamepadValueChangedHandler is signature for the block executed if any element in the gamepad profile changes value.
See: https://developer.apple.com/documentation/GameController/GCGamepadValueChangedHandler
type GCGearShifterElement ¶
type GCGearShifterElement struct {
objectivec.Object
}
An element that represents either a pattern or a sequential gear shift.
Accessing input values ¶
- GCGearShifterElement.PatternInput: The input object for a pattern gear shift.
- GCGearShifterElement.SequentialInput: The input object for a sequential gear shift.
See: https://developer.apple.com/documentation/GameController/GCGearShifterElement
func GCGearShifterElementFromID ¶
func GCGearShifterElementFromID(id objc.ID) GCGearShifterElement
GCGearShifterElementFromID constructs a GCGearShifterElement from an objc.ID.
An element that represents either a pattern or a sequential gear shift.
func NewGCGearShifterElement ¶
func NewGCGearShifterElement() GCGearShifterElement
NewGCGearShifterElement creates a new GCGearShifterElement instance.
func (GCGearShifterElement) Aliases ¶
func (g GCGearShifterElement) Aliases() foundation.INSSet
The element’s aliases to use when accessing it with the subscript notation.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElement/aliases
func (GCGearShifterElement) Autorelease ¶
func (g GCGearShifterElement) Autorelease() GCGearShifterElement
Autorelease adds the receiver to the current autorelease pool.
func (GCGearShifterElement) Init ¶
func (g GCGearShifterElement) Init() GCGearShifterElement
Init initializes the instance.
func (GCGearShifterElement) LocalizedName ¶
func (g GCGearShifterElement) LocalizedName() string
The localized name for the element.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElement/localizedName
func (GCGearShifterElement) PatternInput ¶
func (g GCGearShifterElement) PatternInput() GCSwitchPositionInput
The input object for a pattern gear shift.
Discussion ¶
If this property is `nil`, the gear shift isn’t a pattern gear shift. A pattern gear shift lays out the gears in a pattern that lets the user move to any gear. If the [Position] property of this property is `0`, the gear shift is in neutral. If it’s `-1`, the gear shift is in reverse.
See: https://developer.apple.com/documentation/GameController/GCGearShifterElement/patternInput
func (GCGearShifterElement) SequentialInput ¶
func (g GCGearShifterElement) SequentialInput() GCRelativeInput
The input object for a sequential gear shift.
Discussion ¶
If this property is `nil`, this gear shift isn’t a sequential gear shift. A sequential gear shift requires the user to move through the gears in sequence.
See: https://developer.apple.com/documentation/GameController/GCGearShifterElement/sequentialInput
func (GCGearShifterElement) SfSymbolsName ¶
func (g GCGearShifterElement) SfSymbolsName() string
A system symbol for the element.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElement/sfSymbolsName
type GCGearShifterElementClass ¶
type GCGearShifterElementClass struct {
// contains filtered or unexported fields
}
func GetGCGearShifterElementClass ¶
func GetGCGearShifterElementClass() GCGearShifterElementClass
GetGCGearShifterElementClass returns the class object for GCGearShifterElement.
func (GCGearShifterElementClass) Alloc ¶
func (gc GCGearShifterElementClass) Alloc() GCGearShifterElement
Alloc allocates memory for a new instance of the class.
func (GCGearShifterElementClass) Class ¶
func (gc GCGearShifterElementClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type GCHapticsLocality ¶
type GCHapticsLocality = string
GCHapticsLocality is the location of one or more haptics actuators on a game controller.
See: https://developer.apple.com/documentation/GameController/GCHapticsLocality
type GCInputAxisName ¶
type GCInputAxisName = string
GCInputAxisName is the Objective-C type for an input axis name.
See: https://developer.apple.com/documentation/GameController/GCInputAxisName
var ( // GCInputSteeringWheel is the name of the steering wheel element. // // See: https://developer.apple.com/documentation/GameController/GCInputSteeringWheel-6eb58 GCInputSteeringWheel GCInputAxisName )
type GCInputButtonName ¶
type GCInputButtonName = string
GCInputButtonName is the Objective-C type for an input button name.
See: https://developer.apple.com/documentation/GameController/GCInputButtonName
var ( // GCInputButtonA is the name for the controller’s A button. // // See: https://developer.apple.com/documentation/GameController/GCInputButtonA-a2w2 GCInputButtonA GCInputButtonName // GCInputButtonB is the name for the controller’s B button. // // See: https://developer.apple.com/documentation/GameController/GCInputButtonB-a2w1 GCInputButtonB GCInputButtonName // GCInputButtonHome is the name of the home or logo button element. // // See: https://developer.apple.com/documentation/GameController/GCInputButtonHome-8qxo4 GCInputButtonHome GCInputButtonName // GCInputButtonMenu is the name of the primary menu button element. // // See: https://developer.apple.com/documentation/GameController/GCInputButtonMenu-83i52 GCInputButtonMenu GCInputButtonName // GCInputButtonOptions is the name of the secondary menu button. // // See: https://developer.apple.com/documentation/GameController/GCInputButtonOptions-52c9a GCInputButtonOptions GCInputButtonName // // See: https://developer.apple.com/documentation/GameController/GCInputButtonShare-2xxjg GCInputButtonShare GCInputButtonName // GCInputButtonX is the name for the controller’s X button. // // See: https://developer.apple.com/documentation/GameController/GCInputButtonX-a2wr GCInputButtonX GCInputButtonName // GCInputButtonY is the name for the controller’s Y button. // // See: https://developer.apple.com/documentation/GameController/GCInputButtonY-a2wq GCInputButtonY GCInputButtonName // GCInputDualShockTouchpadButton is the name of the button functionality of the DualShock 4 touchpad. // // See: https://developer.apple.com/documentation/GameController/GCInputDualShockTouchpadButton-47b5w GCInputDualShockTouchpadButton GCInputButtonName // See: https://developer.apple.com/documentation/GameController/GCInputGripButton GCInputGripButton GCInputButtonName // GCInputLeftBumper is the name of the additional left shoulder button. // // See: https://developer.apple.com/documentation/GameController/GCInputLeftBumper GCInputLeftBumper GCInputButtonName // GCInputLeftPaddle is the name for the left paddle input. // // See: https://developer.apple.com/documentation/GameController/GCInputLeftPaddle-818ad GCInputLeftPaddle GCInputButtonName // GCInputLeftShoulder is the name of the left shoulder button. // // See: https://developer.apple.com/documentation/GameController/GCInputLeftShoulder-3i8m0 GCInputLeftShoulder GCInputButtonName // GCInputLeftThumbstickButton is the name of the left thumbstick button element. // // See: https://developer.apple.com/documentation/GameController/GCInputLeftThumbstickButton-4oxvn GCInputLeftThumbstickButton GCInputButtonName // GCInputLeftTrigger is the name of the left trigger. // // See: https://developer.apple.com/documentation/GameController/GCInputLeftTrigger-4gjmx GCInputLeftTrigger GCInputButtonName // GCInputPedalAccelerator is the name of the accelerator element. // // See: https://developer.apple.com/documentation/GameController/GCInputPedalAccelerator-6kjfe GCInputPedalAccelerator GCInputButtonName // GCInputPedalBrake is the name of the brake element. // // See: https://developer.apple.com/documentation/GameController/GCInputPedalBrake-7jcp GCInputPedalBrake GCInputButtonName // GCInputPedalClutch is the name of the clutch element. // // See: https://developer.apple.com/documentation/GameController/GCInputPedalClutch-3cn3p GCInputPedalClutch GCInputButtonName // GCInputRightBumper is the name of the additional right shoulder button. // // See: https://developer.apple.com/documentation/GameController/GCInputRightBumper GCInputRightBumper GCInputButtonName // GCInputRightPaddle is the name for the right paddle input. // // See: https://developer.apple.com/documentation/GameController/GCInputRightPaddle-1p8hd GCInputRightPaddle GCInputButtonName // GCInputRightShoulder is the name of the right shoulder button. // // See: https://developer.apple.com/documentation/GameController/GCInputRightShoulder-513b5 GCInputRightShoulder GCInputButtonName // GCInputRightThumbstickButton is the name of the right thumbstick button element. // // See: https://developer.apple.com/documentation/GameController/GCInputRightThumbstickButton-3k0ld GCInputRightThumbstickButton GCInputButtonName // GCInputRightTrigger is the name of the right trigger. // // See: https://developer.apple.com/documentation/GameController/GCInputRightTrigger-6hvns GCInputRightTrigger GCInputButtonName // See: https://developer.apple.com/documentation/GameController/GCInputThumbstickButton GCInputThumbstickButton GCInputButtonName // See: https://developer.apple.com/documentation/GameController/GCInputTrigger GCInputTrigger GCInputButtonName // GCInputXboxPaddleFour is the name for the controller’s P4 paddle button. // // See: https://developer.apple.com/documentation/GameController/GCInputXboxPaddleFour-4n8ze GCInputXboxPaddleFour GCInputButtonName // GCInputXboxPaddleOne is the name for the controller’s P1 paddle button. // // See: https://developer.apple.com/documentation/GameController/GCInputXboxPaddleOne-795e3 GCInputXboxPaddleOne GCInputButtonName // GCInputXboxPaddleThree is the name for the controller’s P3 paddle button. // // See: https://developer.apple.com/documentation/GameController/GCInputXboxPaddleThree-7u2xy GCInputXboxPaddleThree GCInputButtonName // GCInputXboxPaddleTwo is the name for the controller’s P2 paddle button. // // See: https://developer.apple.com/documentation/GameController/GCInputXboxPaddleTwo-4vrw4 GCInputXboxPaddleTwo GCInputButtonName )
func GCInputArcadeButtonName ¶
func GCInputArcadeButtonName(row int, column int) GCInputButtonName
GCInputArcadeButtonName returns the name of the arcade stick button at the specified location.
See: https://developer.apple.com/documentation/GameController/GCInputArcadeButtonName
func GCInputBackLeftButton ¶
func GCInputBackLeftButton(position int) GCInputButtonName
GCInputBackLeftButton returns the name of the back left button at the specified location.
See: https://developer.apple.com/documentation/GameController/GCInputBackLeftButton
func GCInputBackRightButton ¶
func GCInputBackRightButton(position int) GCInputButtonName
GCInputBackRightButton returns the name of the back right button at the specified location.
See: https://developer.apple.com/documentation/GameController/GCInputBackRightButton
type GCInputDirectionPadName ¶
type GCInputDirectionPadName = string
GCInputDirectionPadName is the Objective-C type for the name of a directional pad.
See: https://developer.apple.com/documentation/GameController/GCInputDirectionPadName
var ( // GCInputDirectionPad is the name of the directional pad element. // // See: https://developer.apple.com/documentation/GameController/GCInputDirectionPad-8igy2 GCInputDirectionPad GCInputDirectionPadName // GCInputDualShockTouchpadOne is the name of the first finger element to touch down on the DualShock 4 touchpad. // // See: https://developer.apple.com/documentation/GameController/GCInputDualShockTouchpadOne-5u54s GCInputDualShockTouchpadOne GCInputDirectionPadName // GCInputDualShockTouchpadTwo is the name of the second finger element to touch down on the DualShock 4 touchpad. // // See: https://developer.apple.com/documentation/GameController/GCInputDualShockTouchpadTwo-38d95 GCInputDualShockTouchpadTwo GCInputDirectionPadName // GCInputLeftThumbstick is the name of the left thumbstick element. // // See: https://developer.apple.com/documentation/GameController/GCInputLeftThumbstick-5tkci GCInputLeftThumbstick GCInputDirectionPadName // GCInputRightThumbstick is the name of the right thumbstick element. // // See: https://developer.apple.com/documentation/GameController/GCInputRightThumbstick-5o085 GCInputRightThumbstick GCInputDirectionPadName // See: https://developer.apple.com/documentation/GameController/GCInputThumbstick GCInputThumbstick GCInputDirectionPadName )
type GCInputElementName ¶
type GCInputElementName = string
GCInputElementName is the Objective-C type for an input element name.
See: https://developer.apple.com/documentation/GameController/GCInputElementName
var ( // GCInputShifter is the name of the shifter element. // // See: https://developer.apple.com/documentation/GameController/GCInputShifter-2p2b7 GCInputShifter GCInputElementName )
type GCInputSwitchName ¶
type GCInputSwitchName = string
GCInputSwitchName is the Objective-C type for an input switch name.
See: https://developer.apple.com/documentation/GameController/GCInputSwitchName
type GCKeyCode ¶
type GCKeyCode = int
GCKeyCode is the key codes for keys on a keyboard.
See: https://developer.apple.com/documentation/GameController/GCKeyCode
type GCKeyboard ¶
type GCKeyboard struct {
objectivec.Object
}
An object that represents a physical keyboard connected to a device.
Overview ¶
To get the keyboard object and its input values, register for the GCKeyboard.GCKeyboardDidConnect (Swift) or GCKeyboardDidConnectNotification (Objective-C) notification for when a keyboard connects to the device, or use the [GCKeyboard.CoalescedKeyboard] class property. Then get the input values from the keyboard object’s GCKeyboard.KeyboardInput controller profile.
Discovering keyboards ¶
- GCKeyboard.GCKeyboardDidConnect: A notification that posts after a keyboard connects to the device.
- GCKeyboard.GCKeyboardDidDisconnect: A notification that posts after a single keyboard, or the last of multiple keyboards, disconnects from the device.
Getting input values ¶
- GCKeyboard.KeyboardInput: The controller profile for the keyboard.
See: https://developer.apple.com/documentation/GameController/GCKeyboard
func GCKeyboardFromID ¶
func GCKeyboardFromID(id objc.ID) GCKeyboard
GCKeyboardFromID constructs a GCKeyboard from an objc.ID.
An object that represents a physical keyboard connected to a device.
func NewGCKeyboard ¶
func NewGCKeyboard() GCKeyboard
NewGCKeyboard creates a new GCKeyboard instance.
func (GCKeyboard) Autorelease ¶
func (g GCKeyboard) Autorelease() GCKeyboard
Autorelease adds the receiver to the current autorelease pool.
func (GCKeyboard) GCKeyboardDidConnect ¶
func (g GCKeyboard) GCKeyboardDidConnect() foundation.NSString
A notification that posts after a keyboard connects to the device.
func (GCKeyboard) GCKeyboardDidDisconnect ¶
func (g GCKeyboard) GCKeyboardDidDisconnect() foundation.NSString
A notification that posts after a single keyboard, or the last of multiple keyboards, disconnects from the device.
func (GCKeyboard) HandlerQueue ¶
func (g GCKeyboard) HandlerQueue() dispatch.Queue
The dispatch queue that the framework uses to call element value change handlers.
Discussion ¶
The default queue is the main queue. Set this property to another queue to asynchronously call value change handlers (see GCControllerAxisInput, GCControllerButtonInput, GCControllerDirectionPad, and GCMotion). For example, if you handle input on another queue, set this property when you first access the input device.
See: https://developer.apple.com/documentation/GameController/GCDevice/handlerQueue
func (GCKeyboard) KeyboardInput ¶
func (g GCKeyboard) KeyboardInput() IGCKeyboardInput
The controller profile for the keyboard.
Discussion ¶
Use this object to get the keyboard’s buttons and button states.
See: https://developer.apple.com/documentation/GameController/GCKeyboard/keyboardInput
func (GCKeyboard) PhysicalInputProfile ¶
func (g GCKeyboard) PhysicalInputProfile() IGCPhysicalInputProfile
The device’s physical input profile, such as a controller’s extended gamepad.
See: https://developer.apple.com/documentation/GameController/GCDevice/physicalInputProfile
func (GCKeyboard) ProductCategory ¶
func (g GCKeyboard) ProductCategory() string
The product category that identifies the type of controller.
See: https://developer.apple.com/documentation/GameController/GCDevice/productCategory
func (GCKeyboard) SetHandlerQueue ¶
func (g GCKeyboard) SetHandlerQueue(value dispatch.Queue)
func (GCKeyboard) VendorName ¶
func (g GCKeyboard) VendorName() string
The manufacturer-provided name for the device, or the user’s name for the device.
Discussion ¶
The value of this property may be `nil` and may not be unique. Use this property to present information about the device to the user.
See: https://developer.apple.com/documentation/GameController/GCDevice/vendorName
type GCKeyboardClass ¶
type GCKeyboardClass struct {
// contains filtered or unexported fields
}
func GetGCKeyboardClass ¶
func GetGCKeyboardClass() GCKeyboardClass
GetGCKeyboardClass returns the class object for GCKeyboard.
func (GCKeyboardClass) Alloc ¶
func (gc GCKeyboardClass) Alloc() GCKeyboard
Alloc allocates memory for a new instance of the class.
func (GCKeyboardClass) Class ¶
func (gc GCKeyboardClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
func (GCKeyboardClass) CoalescedKeyboard ¶
func (_GCKeyboardClass GCKeyboardClass) CoalescedKeyboard() GCKeyboard
The keyboard currently connected to the device.
Discussion ¶
Get the keyboard input values from the keyboard’s [KeyboardInput] controller profile. If the user connects more than one keyboard, the framework represents the combined keyboards with one coalesced keyboard object.
See: https://developer.apple.com/documentation/GameController/GCKeyboard/coalesced
type GCKeyboardInput ¶
type GCKeyboardInput struct {
GCPhysicalInputProfile
}
A controller profile that uses the keyboard as the input device.
Overview ¶
Use this profile to get the state of the keyboard buttons that the GCKeyCode structure defines.
Getting Change Information ¶
- GCKeyboardInput.KeyChangedHandler: The block that the profile calls when the user presses a key.
- GCKeyboardInput.SetKeyChangedHandler
Accessing Buttons ¶
- GCKeyboardInput.AnyKeyPressed: A Boolean value that indicates whether the user is pressing any of the keys.
- GCKeyboardInput.ButtonForKeyCode: Returns the button element for the specified key code.
See: https://developer.apple.com/documentation/GameController/GCKeyboardInput
func GCKeyboardInputFromID ¶
func GCKeyboardInputFromID(id objc.ID) GCKeyboardInput
GCKeyboardInputFromID constructs a GCKeyboardInput from an objc.ID.
A controller profile that uses the keyboard as the input device.
func NewGCKeyboardInput ¶
func NewGCKeyboardInput() GCKeyboardInput
NewGCKeyboardInput creates a new GCKeyboardInput instance.
func (GCKeyboardInput) AnyKeyPressed ¶
func (g GCKeyboardInput) AnyKeyPressed() bool
A Boolean value that indicates whether the user is pressing any of the keys.
Discussion ¶
If true, the user is pressing a key; otherwise, the user isn’t. You can use this property to check whether the user presses any key before getting the state of specific keys.
See: https://developer.apple.com/documentation/GameController/GCKeyboardInput/isAnyKeyPressed
func (GCKeyboardInput) Autorelease ¶
func (g GCKeyboardInput) Autorelease() GCKeyboardInput
Autorelease adds the receiver to the current autorelease pool.
func (GCKeyboardInput) ButtonForKeyCode ¶
func (g GCKeyboardInput) ButtonForKeyCode(code GCKeyCode) IGCControllerButtonInput
Returns the button element for the specified key code.
code: The code for the keyboard button element.
Return Value ¶
The keyboard button element that this profile defines for the specified key code.
Discussion ¶
Alternatively, you can get a button element for a key using the [ObjectForKeyedSubscript] notation that you inherit from GCPhysicalInputProfile, as in `keyboard[GCKeyUpArrow]`.
See: https://developer.apple.com/documentation/GameController/GCKeyboardInput/button(forKeyCode:)
func (GCKeyboardInput) Init ¶
func (g GCKeyboardInput) Init() GCKeyboardInput
Init initializes the instance.
func (GCKeyboardInput) KeyChangedHandler ¶
func (g GCKeyboardInput) KeyChangedHandler() GCKeyboardValueChangedHandler
The block that the profile calls when the user presses a key.
Discussion ¶
If multiple keys change values at the same time, the profile calls this block once for each key that changes.
See: https://developer.apple.com/documentation/GameController/GCKeyboardInput/keyChangedHandler
func (GCKeyboardInput) SetKeyChangedHandler ¶
func (g GCKeyboardInput) SetKeyChangedHandler(value GCKeyboardValueChangedHandler)
type GCKeyboardInputClass ¶
type GCKeyboardInputClass struct {
// contains filtered or unexported fields
}
func GetGCKeyboardInputClass ¶
func GetGCKeyboardInputClass() GCKeyboardInputClass
GetGCKeyboardInputClass returns the class object for GCKeyboardInput.
func (GCKeyboardInputClass) Alloc ¶
func (gc GCKeyboardInputClass) Alloc() GCKeyboardInput
Alloc allocates memory for a new instance of the class.
func (GCKeyboardInputClass) Class ¶
func (gc GCKeyboardInputClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type GCKeyboardValueChangedHandler ¶
type GCKeyboardValueChangedHandler = func(GCKeyboardInput, GCControllerButtonInput, int, bool)
GCKeyboardValueChangedHandler is the signature for the block that the keyboard input profile calls when a key value changes.
See: https://developer.apple.com/documentation/GameController/GCKeyboardValueChangedHandler
type GCLinearInput ¶
type GCLinearInput interface {
objectivec.IObject
// A Boolean value that indicates whether the input value wraps when it reaches the range’s minimum or maximum value.
//
// See: https://developer.apple.com/documentation/GameController/GCLinearInput/canWrap
CanWrap() bool
// A Boolean value that indicates whether the input provides analog values.
//
// See: https://developer.apple.com/documentation/GameController/GCLinearInput/isAnalog
IsAnalog() bool
// The value in unit coordinates.
//
// See: https://developer.apple.com/documentation/GameController/GCLinearInput/value
Value() float32
// The block that the profile calls when an element’s value changes.
//
// See: https://developer.apple.com/documentation/GameController/GCLinearInput/valueDidChangeHandler
ValueDidChangeHandler() func(objc.ID, float32)
// The time of the most recent value change.
//
// See: https://developer.apple.com/documentation/GameController/GCLinearInput/lastValueTimestamp
LastValueTimestamp() float64
// The time in seconds between the last value change and the current time.
//
// See: https://developer.apple.com/documentation/GameController/GCLinearInput/lastValueLatency
LastValueLatency() float64
// One or more physical actions the user performs to manipulate the input.
//
// See: https://developer.apple.com/documentation/GameController/GCLinearInput/sources
Sources() foundation.INSSet
// An object describing the physical extents of the input, if the input represents a physical unit of measurement.
//
// See: https://developer.apple.com/documentation/GameController/GCLinearInput/physicalExtents
PhysicalExtents() GCPhysicalInputExtents
}
The common properties of inputs that provide values in unit coordinates.
See: https://developer.apple.com/documentation/GameController/GCLinearInput
type GCLinearInputObject ¶
type GCLinearInputObject struct {
objectivec.Object
}
GCLinearInputObject wraps an existing Objective-C object that conforms to the GCLinearInput protocol.
func GCLinearInputObjectFromID ¶
func GCLinearInputObjectFromID(id objc.ID) GCLinearInputObject
GCLinearInputObjectFromID constructs a GCLinearInputObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (GCLinearInputObject) BaseObject ¶
func (o GCLinearInputObject) BaseObject() objectivec.Object
func (GCLinearInputObject) CanWrap ¶
func (o GCLinearInputObject) CanWrap() bool
A Boolean value that indicates whether the input value wraps when it reaches the range’s minimum or maximum value.
See: https://developer.apple.com/documentation/GameController/GCLinearInput/canWrap
func (GCLinearInputObject) IsAnalog ¶
func (o GCLinearInputObject) IsAnalog() bool
A Boolean value that indicates whether the input provides analog values.
See: https://developer.apple.com/documentation/GameController/GCLinearInput/isAnalog
func (GCLinearInputObject) LastValueLatency ¶
func (o GCLinearInputObject) LastValueLatency() float64
The time in seconds between the last value change and the current time.
See: https://developer.apple.com/documentation/GameController/GCLinearInput/lastValueLatency
func (GCLinearInputObject) LastValueTimestamp ¶
func (o GCLinearInputObject) LastValueTimestamp() float64
The time of the most recent value change.
See: https://developer.apple.com/documentation/GameController/GCLinearInput/lastValueTimestamp
func (GCLinearInputObject) PhysicalExtents ¶
func (o GCLinearInputObject) PhysicalExtents() GCPhysicalInputExtents
An object describing the physical extents of the input, if the input represents a physical unit of measurement.
See: https://developer.apple.com/documentation/GameController/GCLinearInput/physicalExtents
func (GCLinearInputObject) Sources ¶
func (o GCLinearInputObject) Sources() foundation.INSSet
One or more physical actions the user performs to manipulate the input.
See: https://developer.apple.com/documentation/GameController/GCLinearInput/sources
func (GCLinearInputObject) Value ¶
func (o GCLinearInputObject) Value() float32
The value in unit coordinates.
See: https://developer.apple.com/documentation/GameController/GCLinearInput/value
func (GCLinearInputObject) ValueDidChangeHandler ¶
func (o GCLinearInputObject) ValueDidChangeHandler() func(objc.ID, float32)
The block that the profile calls when an element’s value changes.
See: https://developer.apple.com/documentation/GameController/GCLinearInput/valueDidChangeHandler
type GCMicroGamepad ¶
type GCMicroGamepad struct {
GCPhysicalInputProfile
}
A controller profile that supports the Siri Remote.
Overview ¶
The micro gamepad controller profile supports the following input elements:
- Two digital face buttons (A and X). - One analog directional pad (D-pad) that functions as a touchpad.
Users can rotate game controllers that support the micro gamepad profile, switching them between landscape and portrait orientation. If you want to get directional values according to the orientation, set the GCMicroGamepad.AllowsRotation property to true.
[media-3830807]
Getting the controller ¶
- GCMicroGamepad.Controller: The controller associated with this profile.
Receiving a callback when input values change ¶
- GCMicroGamepad.ValueChangedHandler: The block that this profile calls when an element’s value changes.
- GCMicroGamepad.SetValueChangedHandler
Getting face button inputs ¶
- GCMicroGamepad.ButtonMenu: The menu face button that players use to enter the main menu and pause the game.
- GCMicroGamepad.ButtonA: The button that the user activates by pressing harder on the touchpad.
- GCMicroGamepad.ButtonX: The second face button element.
Getting directional pad inputs ¶
- GCMicroGamepad.Dpad: The controller’s directional pad element.
- GCMicroGamepad.ReportsAbsoluteDpadValues: A Boolean value that indicates whether the directional pad reports absolute or relative values.
- GCMicroGamepad.SetReportsAbsoluteDpadValues
- GCMicroGamepad.AllowsRotation: A Boolean value that indicates whether the profile reports the directional pad values relative to its current orientation.
- GCMicroGamepad.SetAllowsRotation
Setting snapshot avlues ¶
- GCMicroGamepad.SetStateFromMicroGamepad: Copies the input values from a specified micro gamepad to a snapshot of a micro gamepad.
See: https://developer.apple.com/documentation/GameController/GCMicroGamepad
func GCMicroGamepadFromID ¶
func GCMicroGamepadFromID(id objc.ID) GCMicroGamepad
GCMicroGamepadFromID constructs a GCMicroGamepad from an objc.ID.
A controller profile that supports the Siri Remote.
func NewGCMicroGamepad ¶
func NewGCMicroGamepad() GCMicroGamepad
NewGCMicroGamepad creates a new GCMicroGamepad instance.
func (GCMicroGamepad) AllowsRotation ¶
func (g GCMicroGamepad) AllowsRotation() bool
A Boolean value that indicates whether the profile reports the directional pad values relative to its current orientation.
Discussion ¶
If this property is false, the profile reports the value of the directional pad only in portrait orientation even when the user rotates the controller. If this property is true, the profile reports the values using the current orientation. The default value for this property is false.
See: https://developer.apple.com/documentation/GameController/GCMicroGamepad/allowsRotation
func (GCMicroGamepad) Autorelease ¶
func (g GCMicroGamepad) Autorelease() GCMicroGamepad
Autorelease adds the receiver to the current autorelease pool.
func (GCMicroGamepad) ButtonA ¶
func (g GCMicroGamepad) ButtonA() IGCControllerButtonInput
The button that the user activates by pressing harder on the touchpad.
Discussion ¶
This button is digital.
See: https://developer.apple.com/documentation/GameController/GCMicroGamepad/buttonA
func (GCMicroGamepad) ButtonMenu ¶
func (g GCMicroGamepad) ButtonMenu() IGCControllerButtonInput
The menu face button that players use to enter the main menu and pause the game.
See: https://developer.apple.com/documentation/GameController/GCMicroGamepad/buttonMenu
func (GCMicroGamepad) ButtonX ¶
func (g GCMicroGamepad) ButtonX() IGCControllerButtonInput
The second face button element.
Discussion ¶
This button is digital.
See: https://developer.apple.com/documentation/GameController/GCMicroGamepad/buttonX
func (GCMicroGamepad) Controller ¶
func (g GCMicroGamepad) Controller() IGCController
The controller associated with this profile.
See: https://developer.apple.com/documentation/GameController/GCMicroGamepad/controller
func (GCMicroGamepad) Dpad ¶
func (g GCMicroGamepad) Dpad() IGCControllerDirectionPad
The controller’s directional pad element.
Discussion ¶
The directional pad in the micro gamepad profile reports analog directional information.
See: https://developer.apple.com/documentation/GameController/GCMicroGamepad/dpad
func (GCMicroGamepad) Init ¶
func (g GCMicroGamepad) Init() GCMicroGamepad
Init initializes the instance.
func (GCMicroGamepad) ReportsAbsoluteDpadValues ¶
func (g GCMicroGamepad) ReportsAbsoluteDpadValues() bool
A Boolean value that indicates whether the directional pad reports absolute or relative values.
Discussion ¶
If this property is false, the profile assumes the location where the user first touches the pad is the origin value (`0.0,0.0`) for the pad. The profile calculates all subsequent values relative to this position until the user lifts their finger. The next time the user touches the pad, the profile uses that location as the new origin. If this property is true, the profile calculates values relative to the physical center of the touchpad. The default value for this property is false.
See: https://developer.apple.com/documentation/GameController/GCMicroGamepad/reportsAbsoluteDpadValues
func (GCMicroGamepad) SetAllowsRotation ¶
func (g GCMicroGamepad) SetAllowsRotation(value bool)
func (GCMicroGamepad) SetReportsAbsoluteDpadValues ¶
func (g GCMicroGamepad) SetReportsAbsoluteDpadValues(value bool)
func (GCMicroGamepad) SetStateFromMicroGamepad ¶
func (g GCMicroGamepad) SetStateFromMicroGamepad(microGamepad IGCMicroGamepad)
Copies the input values from a specified micro gamepad to a snapshot of a micro gamepad.
microGamepad: The micro gamepad to copy the input values from.
See: https://developer.apple.com/documentation/GameController/GCMicroGamepad/setStateFrom(_:)
func (GCMicroGamepad) SetValueChangedHandler ¶
func (g GCMicroGamepad) SetValueChangedHandler(value GCMicroGamepadValueChangedHandler)
func (GCMicroGamepad) ValueChangedHandler ¶
func (g GCMicroGamepad) ValueChangedHandler() GCMicroGamepadValueChangedHandler
The block that this profile calls when an element’s value changes.
Discussion ¶
If multiple elements change values at the same time, the profile calls this block once for each element that changed. If the value of a child element changes, the profile only calls the block for the containing element.
See: https://developer.apple.com/documentation/GameController/GCMicroGamepad/valueChangedHandler
type GCMicroGamepadClass ¶
type GCMicroGamepadClass struct {
// contains filtered or unexported fields
}
func GetGCMicroGamepadClass ¶
func GetGCMicroGamepadClass() GCMicroGamepadClass
GetGCMicroGamepadClass returns the class object for GCMicroGamepad.
func (GCMicroGamepadClass) Alloc ¶
func (gc GCMicroGamepadClass) Alloc() GCMicroGamepad
Alloc allocates memory for a new instance of the class.
func (GCMicroGamepadClass) Class ¶
func (gc GCMicroGamepadClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type GCMicroGamepadSnapShotDataV100 ¶
type GCMicroGamepadSnapShotDataV100 struct {
ButtonA float32 // The value of the A button.
ButtonX float32
DpadX float32 // The value of the horizontal axis of the dpad.
DpadY float32 // The value of the vertical axis of the dpad.
Size uint16 // The size of the recorded structure, in bytes.
Version uint16 // A value that indicates the version number of the data structure.
}
GCMicroGamepadSnapShotDataV100 - A structure that holds a snapshot of a micro gamepad controller’s input data.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/GameController/GCMicroGamepadSnapShotDataV100
type GCMicroGamepadSnapshotData ¶
type GCMicroGamepadSnapshotData struct {
ButtonA float32
ButtonX float32
DpadX float32
DpadY float32
Size uint16
Version uint16
}
GCMicroGamepadSnapshotData
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/GameController/GCMicroGamepadSnapshotData
type GCMicroGamepadSnapshotDataVersion ¶
type GCMicroGamepadSnapshotDataVersion int
See: https://developer.apple.com/documentation/GameController/GCMicroGamepadSnapshotDataVersion
const (
GCMicroGamepadSnapshotDataVersion1 GCMicroGamepadSnapshotDataVersion = 0x100
)
func (GCMicroGamepadSnapshotDataVersion) String ¶
func (e GCMicroGamepadSnapshotDataVersion) String() string
type GCMicroGamepadValueChangedHandler ¶
type GCMicroGamepadValueChangedHandler = func(GCMicroGamepad, GCControllerElement)
GCMicroGamepadValueChangedHandler is signature for the block that this profile calls when an element’s value changes.
See: https://developer.apple.com/documentation/GameController/GCMicroGamepadValueChangedHandler
type GCMotion ¶
type GCMotion struct {
objectivec.Object
}
A controller profile that supports orientation and motion.
Overview ¶
The motion controller profile provides attitude and rotation data, as well as acceleration and sensor information. Use this profile to get motion input from a controller that measures acceleration and rotation rate. If the controller’s GCMotion.Motion property is a GCMotion object, the controller supports motion.
This illustration shows the direction of the x, y, and z axes of an iPhone when held upright.
[media-2930224]
Getting the Controller ¶
- GCMotion.Controller: The controller for the profile.
Receiving a Callback When Input Values Change ¶
- GCMotion.ValueChangedHandler: The block that the profile calls when an element’s value changes.
- GCMotion.SetValueChangedHandler
Verifying Capabilities ¶
- GCMotion.HasAttitude: A Boolean value that indicates whether the controller provides attitude data.
- GCMotion.HasRotationRate: A Boolean value that indicates whether the controller provides rotation data.
- GCMotion.HasGravityAndUserAcceleration: A Boolean value that indicates whether the controller provides gravity and user acceleration data.
Accessing Attitude and Rotation Data ¶
- GCMotion.Attitude: The attitude of the controller.
- GCMotion.RotationRate: The rotation rate of the controller.
Accessing Gravity and Acceleration Data ¶
- GCMotion.Acceleration: The total acceleration of the controller that includes gravity and the acceleration the user applies to the controller.
- GCMotion.Gravity: The gravity acceleration vector from the controller’s reference frame.
- GCMotion.UserAcceleration: The acceleration that the user applies to the controller.
Accessing Sensor Data ¶
- GCMotion.SensorsRequireManualActivation: A Boolean value that indicates whether the sensors that compute the motion data require manual activation.
- GCMotion.SensorsActive: A Boolean value that indicates whether the sensors that compute the motion data are active.
- GCMotion.SetSensorsActive
Setting Snapshot Values ¶
- GCMotion.SetStateFromMotion: Copies the input values from a specified motion profile to a snapshot of a motion profile.
See: https://developer.apple.com/documentation/GameController/GCMotion
func GCMotionFromID ¶
GCMotionFromID constructs a GCMotion from an objc.ID.
A controller profile that supports orientation and motion.
func (GCMotion) Acceleration ¶
func (g GCMotion) Acceleration() GCAcceleration
The total acceleration of the controller that includes gravity and the acceleration the user applies to the controller.
See: https://developer.apple.com/documentation/GameController/GCMotion/acceleration
func (GCMotion) Attitude ¶
func (g GCMotion) Attitude() GCQuaternion
The attitude of the controller.
Discussion ¶
The is the orientation of a body relative to the controller’s reference frame.
See: https://developer.apple.com/documentation/GameController/GCMotion/attitude
func (GCMotion) Autorelease ¶
Autorelease adds the receiver to the current autorelease pool.
func (GCMotion) Controller ¶
func (g GCMotion) Controller() IGCController
The controller for the profile.
See: https://developer.apple.com/documentation/GameController/GCMotion/controller
func (GCMotion) Gravity ¶
func (g GCMotion) Gravity() GCAcceleration
The gravity acceleration vector from the controller’s reference frame.
See: https://developer.apple.com/documentation/GameController/GCMotion/gravity
func (GCMotion) HasAttitude ¶
A Boolean value that indicates whether the controller provides attitude data.
Discussion ¶
true if the controller provides attitude data; otherwise, false.
See: https://developer.apple.com/documentation/GameController/GCMotion/hasAttitude
func (GCMotion) HasGravityAndUserAcceleration ¶
A Boolean value that indicates whether the controller provides gravity and user acceleration data.
Discussion ¶
true if the controller provides both gravity and user acceleration data; otherwise, false.
See: https://developer.apple.com/documentation/GameController/GCMotion/hasGravityAndUserAcceleration
func (GCMotion) HasRotationRate ¶
A Boolean value that indicates whether the controller provides rotation data.
Discussion ¶
true if the controller provides rotation data; otherwise, false.
See: https://developer.apple.com/documentation/GameController/GCMotion/hasRotationRate
func (GCMotion) Motion ¶
The motion input profile.
See: https://developer.apple.com/documentation/gamecontroller/gccontroller/motion
func (GCMotion) RotationRate ¶
func (g GCMotion) RotationRate() GCRotationRate
The rotation rate of the controller.
Discussion ¶
The is a gyroscopic measurement of the controller’s rotation around the x, y, and z axes.
See: https://developer.apple.com/documentation/GameController/GCMotion/rotationRate
func (GCMotion) SensorsActive ¶
A Boolean value that indicates whether the sensors that compute the motion data are active.
Discussion ¶
true if the sensors are active; otherwise, false.
See: https://developer.apple.com/documentation/GameController/GCMotion/sensorsActive
func (GCMotion) SensorsRequireManualActivation ¶
A Boolean value that indicates whether the sensors that compute the motion data require manual activation.
Discussion ¶
true if the sensors require manual activation; otherwise, false.
See: https://developer.apple.com/documentation/GameController/GCMotion/sensorsRequireManualActivation
func (GCMotion) SetSensorsActive ¶
func (GCMotion) SetStateFromMotion ¶
Copies the input values from a specified motion profile to a snapshot of a motion profile.
motion: The motion profile to copy the input values from.
See: https://developer.apple.com/documentation/GameController/GCMotion/setStateFrom(_:)
func (GCMotion) SetValueChangedHandler ¶
func (g GCMotion) SetValueChangedHandler(value GCMotionValueChangedHandler)
func (GCMotion) UserAcceleration ¶
func (g GCMotion) UserAcceleration() GCAcceleration
The acceleration that the user applies to the controller.
See: https://developer.apple.com/documentation/GameController/GCMotion/userAcceleration
func (GCMotion) ValueChangedHandler ¶
func (g GCMotion) ValueChangedHandler() GCMotionValueChangedHandler
The block that the profile calls when an element’s value changes.
Discussion ¶
If multiple elements change values at the same time, the profile calls this block once for each element that changes. If the value of a subelement changes, the profile only calls the block for the containing element.
See: https://developer.apple.com/documentation/GameController/GCMotion/valueChangedHandler
type GCMotionClass ¶
type GCMotionClass struct {
// contains filtered or unexported fields
}
func GetGCMotionClass ¶
func GetGCMotionClass() GCMotionClass
GetGCMotionClass returns the class object for GCMotion.
func (GCMotionClass) Alloc ¶
func (gc GCMotionClass) Alloc() GCMotion
Alloc allocates memory for a new instance of the class.
func (GCMotionClass) Class ¶
func (gc GCMotionClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type GCMotionValueChangedHandler ¶
type GCMotionValueChangedHandler = func(GCMotion)
GCMotionValueChangedHandler is the signature for the block that the profile calls when an element’s value changes.
See: https://developer.apple.com/documentation/GameController/GCMotionValueChangedHandler
type GCMouse ¶
type GCMouse struct {
objectivec.Object
}
An object that represents a physical mouse connected to a device.
Overview ¶
To get a mouse object and its input values, register for the GCMouse.GCMouseDidConnect (Swift) or GCMouseDidConnectNotification (Objective-C) notification for when a mouse connects to the device. Then register for the GCMouse.GCMouseDidBecomeCurrent (Swift) or GCMouseDidBecomeCurrentNotification (Objective-C) notification for when it becomes the [GCMouse.Current] mouse. Alternatively, use the [GCMouse.Current] class property or the [GCMouse.Mice] class method to get a mouse object. Then get the current input values from the mouse object’s GCMouse.MouseInput controller profile.
Discovering mouse devices ¶
- GCMouse.GCMouseDidConnect: A notification that posts after a mouse connects to the device.
- GCMouse.GCMouseDidDisconnect: A notification that posts after a mouse disconnects from the device.
Handling multiple mouse devices ¶
- GCMouse.GCMouseDidBecomeCurrent: A notification that posts when a mouse becomes the most recent mouse that the user connects.
- GCMouse.GCMouseDidStopBeingCurrent: A notification that posts when a mouse stops being the most recent mouse that the user connects.
Getting input values ¶
- GCMouse.MouseInput: The controller profile for the mouse device.
See: https://developer.apple.com/documentation/GameController/GCMouse
func GCMouseFromID ¶
GCMouseFromID constructs a GCMouse from an objc.ID.
An object that represents a physical mouse connected to a device.
func (GCMouse) Autorelease ¶
Autorelease adds the receiver to the current autorelease pool.
func (GCMouse) GCMouseDidBecomeCurrent ¶
func (g GCMouse) GCMouseDidBecomeCurrent() foundation.NSString
A notification that posts when a mouse becomes the most recent mouse that the user connects.
func (GCMouse) GCMouseDidConnect ¶
func (g GCMouse) GCMouseDidConnect() foundation.NSString
A notification that posts after a mouse connects to the device.
func (GCMouse) GCMouseDidDisconnect ¶
func (g GCMouse) GCMouseDidDisconnect() foundation.NSString
A notification that posts after a mouse disconnects from the device.
func (GCMouse) GCMouseDidStopBeingCurrent ¶
func (g GCMouse) GCMouseDidStopBeingCurrent() foundation.NSString
A notification that posts when a mouse stops being the most recent mouse that the user connects.
func (GCMouse) HandlerQueue ¶
The dispatch queue that the framework uses to call element value change handlers.
Discussion ¶
The default queue is the main queue. Set this property to another queue to asynchronously call value change handlers (see GCControllerAxisInput, GCControllerButtonInput, GCControllerDirectionPad, and GCMotion). For example, if you handle input on another queue, set this property when you first access the input device.
See: https://developer.apple.com/documentation/GameController/GCDevice/handlerQueue
func (GCMouse) MouseInput ¶
func (g GCMouse) MouseInput() IGCMouseInput
The controller profile for the mouse device.
Discussion ¶
Get the mouse’s current state, and input values for its buttons and scroll wheel, from this object.
See: https://developer.apple.com/documentation/GameController/GCMouse/mouseInput
func (GCMouse) PhysicalInputProfile ¶
func (g GCMouse) PhysicalInputProfile() IGCPhysicalInputProfile
The device’s physical input profile, such as a controller’s extended gamepad.
See: https://developer.apple.com/documentation/GameController/GCDevice/physicalInputProfile
func (GCMouse) ProductCategory ¶
The product category that identifies the type of controller.
See: https://developer.apple.com/documentation/GameController/GCDevice/productCategory
func (GCMouse) SetHandlerQueue ¶
func (GCMouse) VendorName ¶
The manufacturer-provided name for the device, or the user’s name for the device.
Discussion ¶
The value of this property may be `nil` and may not be unique. Use this property to present information about the device to the user.
See: https://developer.apple.com/documentation/GameController/GCDevice/vendorName
type GCMouseClass ¶
type GCMouseClass struct {
// contains filtered or unexported fields
}
func GetGCMouseClass ¶
func GetGCMouseClass() GCMouseClass
GetGCMouseClass returns the class object for GCMouse.
func (GCMouseClass) Alloc ¶
func (gc GCMouseClass) Alloc() GCMouse
Alloc allocates memory for a new instance of the class.
func (GCMouseClass) Class ¶
func (gc GCMouseClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
func (GCMouseClass) Current ¶
func (_GCMouseClass GCMouseClass) Current() GCMouse
The most recent mouse that the user connects.
See: https://developer.apple.com/documentation/GameController/GCMouse/current
func (GCMouseClass) Mice ¶
func (_GCMouseClass GCMouseClass) Mice() []GCMouse
Returns any mice that the user connects to the device.
Return Value ¶
The currently connected mouse devices.
See: https://developer.apple.com/documentation/GameController/GCMouse/mice()
type GCMouseInput ¶
type GCMouseInput struct {
GCPhysicalInputProfile
}
A controller profile that tracks input from a mouse.
Overview ¶
This profile supports a mouse with the following features:
- A two-axis cursor and scroll - A left button - An optional right button - An optional middle button - An optional set of auxiliary buttons
This profile provides only raw mouse movement delta values. For the cursor position at a specific time, use the UIHoverGestureRecognizer class and the [NSEvent] [GCMouseInput.MouseLocation] method.
Getting Change Information ¶
- GCMouseInput.MouseMovedHandler: The block that the profile calls when the mouse moves.
- GCMouseInput.SetMouseMovedHandler
Accessing Buttons ¶
- GCMouseInput.LeftButton: The left button on the mouse.
- GCMouseInput.RightButton: The optional right button on the mouse.
- GCMouseInput.MiddleButton: The optional middle button on the mouse.
- GCMouseInput.AuxiliaryButtons: The optional additional buttons on the mouse.
Scrolling ¶
- GCMouseInput.Scroll: The location of the directional pad cursor with an undefined range.
See: https://developer.apple.com/documentation/GameController/GCMouseInput
func GCMouseInputFromID ¶
func GCMouseInputFromID(id objc.ID) GCMouseInput
GCMouseInputFromID constructs a GCMouseInput from an objc.ID.
A controller profile that tracks input from a mouse.
func NewGCMouseInput ¶
func NewGCMouseInput() GCMouseInput
NewGCMouseInput creates a new GCMouseInput instance.
func (GCMouseInput) Autorelease ¶
func (g GCMouseInput) Autorelease() GCMouseInput
Autorelease adds the receiver to the current autorelease pool.
func (GCMouseInput) AuxiliaryButtons ¶
func (g GCMouseInput) AuxiliaryButtons() []GCControllerButtonInput
The optional additional buttons on the mouse.
Discussion ¶
If the mouse doesn’t have additional buttons, this property is `nil`.
See: https://developer.apple.com/documentation/GameController/GCMouseInput/auxiliaryButtons
func (GCMouseInput) LeftButton ¶
func (g GCMouseInput) LeftButton() IGCControllerButtonInput
The left button on the mouse.
See: https://developer.apple.com/documentation/GameController/GCMouseInput/leftButton
func (GCMouseInput) MiddleButton ¶
func (g GCMouseInput) MiddleButton() IGCControllerButtonInput
The optional middle button on the mouse.
Discussion ¶
If the mouse doesn’t have a middle button, this property is `nil`.
See: https://developer.apple.com/documentation/GameController/GCMouseInput/middleButton
func (GCMouseInput) MouseMovedHandler ¶
func (g GCMouseInput) MouseMovedHandler() GCMouseMoved
The block that the profile calls when the mouse moves.
See: https://developer.apple.com/documentation/GameController/GCMouseInput/mouseMovedHandler
func (GCMouseInput) RightButton ¶
func (g GCMouseInput) RightButton() IGCControllerButtonInput
The optional right button on the mouse.
Discussion ¶
If the mouse doesn’t have a right button, this property is `nil`.
See: https://developer.apple.com/documentation/GameController/GCMouseInput/rightButton
func (GCMouseInput) Scroll ¶
func (g GCMouseInput) Scroll() IGCDeviceCursor
The location of the directional pad cursor with an undefined range.
See: https://developer.apple.com/documentation/GameController/GCMouseInput/scroll
func (GCMouseInput) SetMouseMovedHandler ¶
func (g GCMouseInput) SetMouseMovedHandler(value GCMouseMoved)
type GCMouseInputClass ¶
type GCMouseInputClass struct {
// contains filtered or unexported fields
}
func GetGCMouseInputClass ¶
func GetGCMouseInputClass() GCMouseInputClass
GetGCMouseInputClass returns the class object for GCMouseInput.
func (GCMouseInputClass) Alloc ¶
func (gc GCMouseInputClass) Alloc() GCMouseInput
Alloc allocates memory for a new instance of the class.
func (GCMouseInputClass) Class ¶
func (gc GCMouseInputClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
func (GCMouseInputClass) MouseLocation ¶
func (_GCMouseInputClass GCMouseInputClass) MouseLocation() corefoundation.CGPoint
Reports the current mouse position in screen coordinates.
See: https://developer.apple.com/documentation/AppKit/NSEvent/mouseLocation
func (GCMouseInputClass) SetMouseLocation ¶
func (_GCMouseInputClass GCMouseInputClass) SetMouseLocation(value corefoundation.CGPoint)
type GCMouseMoved ¶
type GCMouseMoved = func(GCMouseInput, float32, float32)
GCMouseMoved is the signature for the block that the mouse input profile calls when the mouse moves.
See: https://developer.apple.com/documentation/GameController/GCMouseMoved
type GCPhysicalInputElement ¶
type GCPhysicalInputElement interface {
objectivec.IObject
// The localized name for the element.
//
// See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElement/localizedName
LocalizedName() string
// A system symbol for the element.
//
// See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElement/sfSymbolsName
SfSymbolsName() string
// The element’s aliases to use when accessing it with the subscript notation.
//
// See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElement/aliases
Aliases() foundation.INSSet
}
The common properties of physical input elements.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElement
type GCPhysicalInputElementCollection ¶
type GCPhysicalInputElementCollection struct {
objectivec.Object
}
A collection of physical input elements.
Getting elements in the collection ¶
- GCPhysicalInputElementCollection.ElementEnumerator: Returns an enumerator to iterate the elements in the collection.
- GCPhysicalInputElementCollection.Count: The number of elements in the collection.
Accessing elements by key and alias ¶
- GCPhysicalInputElementCollection.ObjectForKeyedSubscript: Returns the element in the collection for the specified key.
- GCPhysicalInputElementCollection.ElementForAlias: Returns the element in the collection that uses the specified alias.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElementCollection-c.class
func GCPhysicalInputElementCollectionFromID ¶
func GCPhysicalInputElementCollectionFromID(id objc.ID) GCPhysicalInputElementCollection
GCPhysicalInputElementCollectionFromID constructs a GCPhysicalInputElementCollection from an objc.ID.
A collection of physical input elements.
func NewGCPhysicalInputElementCollection ¶
func NewGCPhysicalInputElementCollection() GCPhysicalInputElementCollection
NewGCPhysicalInputElementCollection creates a new GCPhysicalInputElementCollection instance.
func (GCPhysicalInputElementCollection) Autorelease ¶
func (g GCPhysicalInputElementCollection) Autorelease() GCPhysicalInputElementCollection
Autorelease adds the receiver to the current autorelease pool.
func (GCPhysicalInputElementCollection) Count ¶
func (g GCPhysicalInputElementCollection) Count() uint
The number of elements in the collection.
func (GCPhysicalInputElementCollection) ElementEnumerator ¶
func (g GCPhysicalInputElementCollection) ElementEnumerator() foundation.NSEnumerator
Returns an enumerator to iterate the elements in the collection.
Return Value ¶
An enumerator for the collection.
func (GCPhysicalInputElementCollection) ElementForAlias ¶
func (g GCPhysicalInputElementCollection) ElementForAlias(alias coreservices.Key) objectivec.IObject
Returns the element in the collection that uses the specified alias.
alias: An alias for the element.
Return Value ¶
An element in the collection.
func (GCPhysicalInputElementCollection) Init ¶
func (g GCPhysicalInputElementCollection) Init() GCPhysicalInputElementCollection
Init initializes the instance.
func (GCPhysicalInputElementCollection) ObjectForKeyedSubscript ¶
func (g GCPhysicalInputElementCollection) ObjectForKeyedSubscript(key coreservices.Key) objectivec.IObject
Returns the element in the collection for the specified key.
key: The key that identifies the element.
Return Value ¶
An element in the collection.
type GCPhysicalInputElementCollectionClass ¶
type GCPhysicalInputElementCollectionClass struct {
// contains filtered or unexported fields
}
func GetGCPhysicalInputElementCollectionClass ¶
func GetGCPhysicalInputElementCollectionClass() GCPhysicalInputElementCollectionClass
GetGCPhysicalInputElementCollectionClass returns the class object for GCPhysicalInputElementCollection.
func (GCPhysicalInputElementCollectionClass) Alloc ¶
func (gc GCPhysicalInputElementCollectionClass) Alloc() GCPhysicalInputElementCollection
Alloc allocates memory for a new instance of the class.
func (GCPhysicalInputElementCollectionClass) Class ¶
func (gc GCPhysicalInputElementCollectionClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type GCPhysicalInputElementName ¶
type GCPhysicalInputElementName interface {
objectivec.IObject
}
The name of a physical input element.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElementName-c.protocol
type GCPhysicalInputElementNameObject ¶
type GCPhysicalInputElementNameObject struct {
objectivec.Object
}
GCPhysicalInputElementNameObject wraps an existing Objective-C object that conforms to the GCPhysicalInputElementName protocol.
func GCPhysicalInputElementNameObjectFromID ¶
func GCPhysicalInputElementNameObjectFromID(id objc.ID) GCPhysicalInputElementNameObject
GCPhysicalInputElementNameObjectFromID constructs a GCPhysicalInputElementNameObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (GCPhysicalInputElementNameObject) BaseObject ¶
func (o GCPhysicalInputElementNameObject) BaseObject() objectivec.Object
type GCPhysicalInputElementObject ¶
type GCPhysicalInputElementObject struct {
objectivec.Object
}
GCPhysicalInputElementObject wraps an existing Objective-C object that conforms to the GCPhysicalInputElement protocol.
func GCPhysicalInputElementObjectFromID ¶
func GCPhysicalInputElementObjectFromID(id objc.ID) GCPhysicalInputElementObject
GCPhysicalInputElementObjectFromID constructs a GCPhysicalInputElementObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (GCPhysicalInputElementObject) Aliases ¶
func (o GCPhysicalInputElementObject) Aliases() foundation.INSSet
The element’s aliases to use when accessing it with the subscript notation.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElement/aliases
func (GCPhysicalInputElementObject) BaseObject ¶
func (o GCPhysicalInputElementObject) BaseObject() objectivec.Object
func (GCPhysicalInputElementObject) LocalizedName ¶
func (o GCPhysicalInputElementObject) LocalizedName() string
The localized name for the element.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElement/localizedName
func (GCPhysicalInputElementObject) SfSymbolsName ¶
func (o GCPhysicalInputElementObject) SfSymbolsName() string
A system symbol for the element.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElement/sfSymbolsName
type GCPhysicalInputExtents ¶
type GCPhysicalInputExtents interface {
objectivec.IObject
// The maximum value for the physical extent of the input.
//
// See: https://developer.apple.com/documentation/GameController/GCPhysicalInputExtents/maximumValue
MaximumValue() float64
// The minimum value for the physical extent of the input.
//
// See: https://developer.apple.com/documentation/GameController/GCPhysicalInputExtents/minimumValue
MinimumValue() float64
// The value of the input, scaled into physical units.
//
// See: https://developer.apple.com/documentation/GameController/GCPhysicalInputExtents/scaledValue
ScaledValue() float64
}
Physical extents scale the normalized value reported by GCLinearInput into physical units.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputExtents
type GCPhysicalInputExtentsObject ¶
type GCPhysicalInputExtentsObject struct {
objectivec.Object
}
GCPhysicalInputExtentsObject wraps an existing Objective-C object that conforms to the GCPhysicalInputExtents protocol.
func GCPhysicalInputExtentsObjectFromID ¶
func GCPhysicalInputExtentsObjectFromID(id objc.ID) GCPhysicalInputExtentsObject
GCPhysicalInputExtentsObjectFromID constructs a GCPhysicalInputExtentsObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (GCPhysicalInputExtentsObject) BaseObject ¶
func (o GCPhysicalInputExtentsObject) BaseObject() objectivec.Object
func (GCPhysicalInputExtentsObject) MaximumValue ¶
func (o GCPhysicalInputExtentsObject) MaximumValue() float64
The maximum value for the physical extent of the input.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputExtents/maximumValue
func (GCPhysicalInputExtentsObject) MinimumValue ¶
func (o GCPhysicalInputExtentsObject) MinimumValue() float64
The minimum value for the physical extent of the input.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputExtents/minimumValue
func (GCPhysicalInputExtentsObject) ScaledValue ¶
func (o GCPhysicalInputExtentsObject) ScaledValue() float64
The value of the input, scaled into physical units.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputExtents/scaledValue
type GCPhysicalInputProfile ¶
type GCPhysicalInputProfile struct {
objectivec.Object
}
The base class for controller profiles that support physical buttons, thumbsticks, and directional pads.
Overview ¶
This class provides properties and methods for accessing common elements of controllers, and for creating snapshots of profiles.
Getting the device ¶
- GCPhysicalInputProfile.Device: The physical device that the profile represents.
Getting change information ¶
- GCPhysicalInputProfile.LastEventTimestamp: The time of the most recent change to an element’s value.
- GCPhysicalInputProfile.ValueDidChangeHandler: The block that the profile calls when an element’s value changes.
- GCPhysicalInputProfile.SetValueDidChangeHandler
Accessing elements by name or key ¶
- GCPhysicalInputProfile.Elements: The elements in the profile as key-value pairs for lookup by name.
- GCPhysicalInputProfile.Buttons: The buttons in the profile as key-value pairs for lookup by name.
- GCPhysicalInputProfile.Axes: The axes in the profile as key-value pairs for lookup by name.
- GCPhysicalInputProfile.Dpads: The directional pads in the profile as key-value pairs for lookup by name.
- GCPhysicalInputProfile.Touchpads: The touchpads in the profile as key-value pairs for lookup by name.
- GCPhysicalInputProfile.ObjectForKeyedSubscript: Returns the element that the key specifies.
Getting elements by type ¶
- GCPhysicalInputProfile.AllElements: The elements in the profile.
- GCPhysicalInputProfile.AllButtons: The buttons in the profile.
- GCPhysicalInputProfile.AllAxes: The axes in the profile.
- GCPhysicalInputProfile.AllDpads: The directional pads in the profile.
- GCPhysicalInputProfile.AllTouchpads: The touchpads in the profile.
Setting snapshot values ¶
- GCPhysicalInputProfile.Capture: Returns a snapshot of the profile with its current element values.
- GCPhysicalInputProfile.SetStateFromPhysicalInput: Copies the input values from a specified physical input profile to a snapshot of the profile.
Remapping input elements ¶
- GCPhysicalInputProfile.HasRemappedElements: A Boolean value that indicates whether the user remaps elements in this profile.
- GCPhysicalInputProfile.MappedElementAliasForPhysicalInputName: Returns the name of the input element to which the user remaps the given physical element.
- GCPhysicalInputProfile.MappedPhysicalInputNamesForElementAlias: Returns the physical input elements to which the user remaps the given input element.
- GCPhysicalInputProfile.GCControllerUserCustomizationsDidChange: A notification that posts when the user customizes the button mappings or other settings of a controller.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputProfile
func GCPhysicalInputProfileFromID ¶
func GCPhysicalInputProfileFromID(id objc.ID) GCPhysicalInputProfile
GCPhysicalInputProfileFromID constructs a GCPhysicalInputProfile from an objc.ID.
The base class for controller profiles that support physical buttons, thumbsticks, and directional pads.
func NewGCPhysicalInputProfile ¶
func NewGCPhysicalInputProfile() GCPhysicalInputProfile
NewGCPhysicalInputProfile creates a new GCPhysicalInputProfile instance.
func (GCPhysicalInputProfile) AllAxes ¶
func (g GCPhysicalInputProfile) AllAxes() foundation.INSSet
The axes in the profile.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputProfile/allAxes
func (GCPhysicalInputProfile) AllButtons ¶
func (g GCPhysicalInputProfile) AllButtons() foundation.INSSet
The buttons in the profile.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputProfile/allButtons
func (GCPhysicalInputProfile) AllDpads ¶
func (g GCPhysicalInputProfile) AllDpads() foundation.INSSet
The directional pads in the profile.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputProfile/allDpads
func (GCPhysicalInputProfile) AllElements ¶
func (g GCPhysicalInputProfile) AllElements() foundation.INSSet
The elements in the profile.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputProfile/allElements
func (GCPhysicalInputProfile) AllTouchpads ¶
func (g GCPhysicalInputProfile) AllTouchpads() foundation.INSSet
The touchpads in the profile.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputProfile/allTouchpads
func (GCPhysicalInputProfile) Autorelease ¶
func (g GCPhysicalInputProfile) Autorelease() GCPhysicalInputProfile
Autorelease adds the receiver to the current autorelease pool.
func (GCPhysicalInputProfile) Axes ¶
func (g GCPhysicalInputProfile) Axes() foundation.INSDictionary
The axes in the profile as key-value pairs for lookup by name.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputProfile/axes
func (GCPhysicalInputProfile) Buttons ¶
func (g GCPhysicalInputProfile) Buttons() foundation.INSDictionary
The buttons in the profile as key-value pairs for lookup by name.
Discussion ¶
Use the GCInputXboxPaddleOne constant to get the P1 paddle button for an Xbox controller.
For more button names, see Extended gamepad input names and Xbox controller input names.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputProfile/buttons
func (GCPhysicalInputProfile) Capture ¶
func (g GCPhysicalInputProfile) Capture() IGCPhysicalInputProfile
Returns a snapshot of the profile with its current element values.
Return Value ¶
A snapshot of the profile.
Discussion ¶
A snapshot is a copy of profile at a moment in time with its current element values. Unlike other profiles, you can set the values of a snapshot’s elements.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputProfile/capture()
func (GCPhysicalInputProfile) Device ¶
func (g GCPhysicalInputProfile) Device() GCDevice
The physical device that the profile represents.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputProfile/device
func (GCPhysicalInputProfile) Dpads ¶
func (g GCPhysicalInputProfile) Dpads() foundation.INSDictionary
The directional pads in the profile as key-value pairs for lookup by name.
Discussion ¶
Use the GCInputDualShockTouchpadOne name to access an element on a DualShock controller.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputProfile/dpads
func (GCPhysicalInputProfile) Elements ¶
func (g GCPhysicalInputProfile) Elements() foundation.INSDictionary
The elements in the profile as key-value pairs for lookup by name.
Discussion ¶
Use this property to access elements by name. For example, use the name `“Button A”` to get the face button of an extended gamepad profile.
For more button names, see Extended gamepad input names.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputProfile/elements
func (GCPhysicalInputProfile) ExtendedGamepad ¶
func (g GCPhysicalInputProfile) ExtendedGamepad() IGCExtendedGamepad
The extended gamepad profile.
See: https://developer.apple.com/documentation/gamecontroller/gccontroller/extendedgamepad
func (GCPhysicalInputProfile) GCControllerUserCustomizationsDidChange ¶
func (g GCPhysicalInputProfile) GCControllerUserCustomizationsDidChange() foundation.NSString
A notification that posts when the user customizes the button mappings or other settings of a controller.
func (GCPhysicalInputProfile) Gamepad ¶
func (g GCPhysicalInputProfile) Gamepad() unsafe.Pointer
The gamepad profile.
See: https://developer.apple.com/documentation/gamecontroller/gccontroller/gamepad
func (GCPhysicalInputProfile) HasRemappedElements ¶
func (g GCPhysicalInputProfile) HasRemappedElements() bool
A Boolean value that indicates whether the user remaps elements in this profile.
Discussion ¶
If true, the user remaps one or more elements; otherwise, this property is false.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputProfile/hasRemappedElements
func (GCPhysicalInputProfile) Init ¶
func (g GCPhysicalInputProfile) Init() GCPhysicalInputProfile
Init initializes the instance.
func (GCPhysicalInputProfile) LastEventTimestamp ¶
func (g GCPhysicalInputProfile) LastEventTimestamp() float64
The time of the most recent change to an element’s value.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputProfile/lastEventTimestamp
func (GCPhysicalInputProfile) MappedElementAliasForPhysicalInputName ¶
func (g GCPhysicalInputProfile) MappedElementAliasForPhysicalInputName(inputName string) string
Returns the name of the input element to which the user remaps the given physical element.
inputName: The name of the physical element. For possible values, see Extended gamepad input names.
Return Value ¶
The name of the input element to which the user remaps the physical element, or `nil` if the user doesn’t remap the physical element.
Discussion ¶
Use this method to get the alias for an input element. For example, if the user remaps a physical press of the controller’s A button to button B, then passing GCInputButtonA to this method returns GCInputButtonB.
func (GCPhysicalInputProfile) MappedPhysicalInputNamesForElementAlias ¶
func (g GCPhysicalInputProfile) MappedPhysicalInputNamesForElementAlias(elementAlias string) foundation.INSSet
Returns the physical input elements to which the user remaps the given input element.
elementAlias: The name of the input element too which physical input elements remap. For possible values, see Extended gamepad input names.
Return Value ¶
The names of the physical input element to which the user remaps the given element.
Discussion ¶
For example, if the user maps a physical press of A button , B button, and X button to button B, then passing GCInputButtonB returns a set that contains GCInputButtonA, GCInputButtonB, and GCInputButtonX.
func (GCPhysicalInputProfile) MicroGamepad ¶
func (g GCPhysicalInputProfile) MicroGamepad() IGCMicroGamepad
The micro gamepad profile.
See: https://developer.apple.com/documentation/gamecontroller/gccontroller/microgamepad
func (GCPhysicalInputProfile) Motion ¶
func (g GCPhysicalInputProfile) Motion() IGCMotion
The motion input profile.
See: https://developer.apple.com/documentation/gamecontroller/gccontroller/motion
func (GCPhysicalInputProfile) ObjectForKeyedSubscript ¶
func (g GCPhysicalInputProfile) ObjectForKeyedSubscript(key string) IGCControllerElement
Returns the element that the key specifies.
key: A key that identifies an element.
Return Value ¶
The element that matches the key.
Discussion ¶
You can access elements of a profile using a subscript notation. For example, get the button with the X label from an instance of GCMicroGamepad using `microGamepad[”Button X”]`.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputProfile/subscript(_:)
func (GCPhysicalInputProfile) PhysicalInputProfile ¶
func (g GCPhysicalInputProfile) PhysicalInputProfile() IGCPhysicalInputProfile
The physical input profile for the controller.
See: https://developer.apple.com/documentation/gamecontroller/gccontroller/physicalinputprofile
func (GCPhysicalInputProfile) SetExtendedGamepad ¶
func (g GCPhysicalInputProfile) SetExtendedGamepad(value IGCExtendedGamepad)
func (GCPhysicalInputProfile) SetGamepad ¶
func (g GCPhysicalInputProfile) SetGamepad(value unsafe.Pointer)
func (GCPhysicalInputProfile) SetMicroGamepad ¶
func (g GCPhysicalInputProfile) SetMicroGamepad(value IGCMicroGamepad)
func (GCPhysicalInputProfile) SetMotion ¶
func (g GCPhysicalInputProfile) SetMotion(value IGCMotion)
func (GCPhysicalInputProfile) SetPhysicalInputProfile ¶
func (g GCPhysicalInputProfile) SetPhysicalInputProfile(value IGCPhysicalInputProfile)
func (GCPhysicalInputProfile) SetStateFromPhysicalInput ¶
func (g GCPhysicalInputProfile) SetStateFromPhysicalInput(physicalInput IGCPhysicalInputProfile)
Copies the input values from a specified physical input profile to a snapshot of the profile.
physicalInput: The physical input profile to copy the input values from.
Discussion ¶
If the associated controller isn’t a snapshot, this method does nothing.
func (GCPhysicalInputProfile) SetValueDidChangeHandler ¶
func (g GCPhysicalInputProfile) SetValueDidChangeHandler(value GCPhysicalInputProfileGCControllerElementHandler)
func (GCPhysicalInputProfile) Touchpads ¶
func (g GCPhysicalInputProfile) Touchpads() foundation.INSDictionary
The touchpads in the profile as key-value pairs for lookup by name.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputProfile/touchpads
func (GCPhysicalInputProfile) ValueDidChangeHandler ¶
func (g GCPhysicalInputProfile) ValueDidChangeHandler() GCPhysicalInputProfileGCControllerElementHandler
The block that the profile calls when an element’s value changes.
Discussion ¶
The block’s parameters are:
`profile`: The controller profile that contains the element. `element`: The element with the value that changes.
If multiple elements change values at the same time, the profile calls this block once for each element that changes. If the value of a subelement changes, the profile only calls the block for the containing element.
type GCPhysicalInputProfileClass ¶
type GCPhysicalInputProfileClass struct {
// contains filtered or unexported fields
}
func GetGCPhysicalInputProfileClass ¶
func GetGCPhysicalInputProfileClass() GCPhysicalInputProfileClass
GetGCPhysicalInputProfileClass returns the class object for GCPhysicalInputProfile.
func (GCPhysicalInputProfileClass) Alloc ¶
func (gc GCPhysicalInputProfileClass) Alloc() GCPhysicalInputProfile
Alloc allocates memory for a new instance of the class.
func (GCPhysicalInputProfileClass) Class ¶
func (gc GCPhysicalInputProfileClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type GCPhysicalInputProfileGCControllerElementHandler ¶
type GCPhysicalInputProfileGCControllerElementHandler = func(*GCPhysicalInputProfile, *GCControllerElement)
GCPhysicalInputProfileGCControllerElementHandler is the signature for a completion handler block.
type GCPhysicalInputSource ¶
type GCPhysicalInputSource interface {
objectivec.IObject
// The localized name for the element without any system-level remapping of the controls.
//
// See: https://developer.apple.com/documentation/GameController/GCPhysicalInputSource/elementLocalizedName
ElementLocalizedName() string
// A system symbol for the element without any system-level remapping of the controls.
//
// See: https://developer.apple.com/documentation/GameController/GCPhysicalInputSource/sfSymbolsName
SfSymbolsName() string
// The element’s true aliases without any system-level remapping of the controls.
//
// See: https://developer.apple.com/documentation/GameController/GCPhysicalInputSource/elementAliases
ElementAliases() foundation.INSSet
// The directional input, if any, that a physical input source involves.
//
// See: https://developer.apple.com/documentation/GameController/GCPhysicalInputSource/direction
Direction() GCPhysicalInputSourceDirection
}
A protocol for a description of an element without any system-level remapping of the controls.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputSource
type GCPhysicalInputSourceDirection ¶
type GCPhysicalInputSourceDirection uint
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputSourceDirection
const ( // GCPhysicalInputSourceDirectionDown: The physical input source supports the down direction. GCPhysicalInputSourceDirectionDown GCPhysicalInputSourceDirection = 4 // GCPhysicalInputSourceDirectionLeft: The physical input source supports the left direction. GCPhysicalInputSourceDirectionLeft GCPhysicalInputSourceDirection = 8 // GCPhysicalInputSourceDirectionNotApplicable: The physical input source doesn’t support directions. GCPhysicalInputSourceDirectionNotApplicable GCPhysicalInputSourceDirection = 0 // GCPhysicalInputSourceDirectionRight: The physical input source supports the right direction. GCPhysicalInputSourceDirectionRight GCPhysicalInputSourceDirection = 2 // GCPhysicalInputSourceDirectionUp: The physical input source contains a value for the up direction. GCPhysicalInputSourceDirectionUp GCPhysicalInputSourceDirection = 1 )
func (GCPhysicalInputSourceDirection) String ¶
func (e GCPhysicalInputSourceDirection) String() string
type GCPhysicalInputSourceObject ¶
type GCPhysicalInputSourceObject struct {
objectivec.Object
}
GCPhysicalInputSourceObject wraps an existing Objective-C object that conforms to the GCPhysicalInputSource protocol.
func GCPhysicalInputSourceObjectFromID ¶
func GCPhysicalInputSourceObjectFromID(id objc.ID) GCPhysicalInputSourceObject
GCPhysicalInputSourceObjectFromID constructs a GCPhysicalInputSourceObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (GCPhysicalInputSourceObject) BaseObject ¶
func (o GCPhysicalInputSourceObject) BaseObject() objectivec.Object
func (GCPhysicalInputSourceObject) Direction ¶
func (o GCPhysicalInputSourceObject) Direction() GCPhysicalInputSourceDirection
The directional input, if any, that a physical input source involves.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputSource/direction
func (GCPhysicalInputSourceObject) ElementAliases ¶
func (o GCPhysicalInputSourceObject) ElementAliases() foundation.INSSet
The element’s true aliases without any system-level remapping of the controls.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputSource/elementAliases
func (GCPhysicalInputSourceObject) ElementLocalizedName ¶
func (o GCPhysicalInputSourceObject) ElementLocalizedName() string
The localized name for the element without any system-level remapping of the controls.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputSource/elementLocalizedName
func (GCPhysicalInputSourceObject) SfSymbolsName ¶
func (o GCPhysicalInputSourceObject) SfSymbolsName() string
A system symbol for the element without any system-level remapping of the controls.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputSource/sfSymbolsName
type GCPoint2 ¶
type GCPoint2 struct {
X float32 // The x-coordinate for the point.
Y float32 // The y-coordinate for the point.
}
GCPoint2 - A structure that represents a normalized point in a two-dimensional coordinate system.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/GameController/GCPoint2
var ( // GCPoint2Zero is the origin for a two dimensional point. // // See: https://developer.apple.com/documentation/GameController/GCPoint2Zero GCPoint2Zero GCPoint2 )
type GCPressedStateInput ¶
type GCPressedStateInput interface {
objectivec.IObject
// A Boolean value that indicates whether the user presses the button.
//
// See: https://developer.apple.com/documentation/GameController/GCPressedStateInput/isPressed
IsPressed() bool
// The time of the most recent press state change.
//
// See: https://developer.apple.com/documentation/GameController/GCPressedStateInput/lastPressedStateTimestamp
LastPressedStateTimestamp() float64
// The time in seconds between the last press state change and the current time.
//
// See: https://developer.apple.com/documentation/GameController/GCPressedStateInput/lastPressedStateLatency
LastPressedStateLatency() float64
// The block that the profile calls when an element’s press state changes.
//
// See: https://developer.apple.com/documentation/GameController/GCPressedStateInput/pressedDidChangeHandler
PressedDidChangeHandler() func(objc.ID, bool)
// One or more physical actions the user performs to manipulate the input.
//
// See: https://developer.apple.com/documentation/GameController/GCPressedStateInput/sources
Sources() foundation.INSSet
}
The common properties for an element that has press state input, such as input from a button.
See: https://developer.apple.com/documentation/GameController/GCPressedStateInput
type GCPressedStateInputObject ¶
type GCPressedStateInputObject struct {
objectivec.Object
}
GCPressedStateInputObject wraps an existing Objective-C object that conforms to the GCPressedStateInput protocol.
func GCPressedStateInputObjectFromID ¶
func GCPressedStateInputObjectFromID(id objc.ID) GCPressedStateInputObject
GCPressedStateInputObjectFromID constructs a GCPressedStateInputObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (GCPressedStateInputObject) BaseObject ¶
func (o GCPressedStateInputObject) BaseObject() objectivec.Object
func (GCPressedStateInputObject) IsPressed ¶
func (o GCPressedStateInputObject) IsPressed() bool
A Boolean value that indicates whether the user presses the button.
See: https://developer.apple.com/documentation/GameController/GCPressedStateInput/isPressed
func (GCPressedStateInputObject) LastPressedStateLatency ¶
func (o GCPressedStateInputObject) LastPressedStateLatency() float64
The time in seconds between the last press state change and the current time.
See: https://developer.apple.com/documentation/GameController/GCPressedStateInput/lastPressedStateLatency
func (GCPressedStateInputObject) LastPressedStateTimestamp ¶
func (o GCPressedStateInputObject) LastPressedStateTimestamp() float64
The time of the most recent press state change.
func (GCPressedStateInputObject) PressedDidChangeHandler ¶
func (o GCPressedStateInputObject) PressedDidChangeHandler() func(objc.ID, bool)
The block that the profile calls when an element’s press state changes.
See: https://developer.apple.com/documentation/GameController/GCPressedStateInput/pressedDidChangeHandler
func (GCPressedStateInputObject) Sources ¶
func (o GCPressedStateInputObject) Sources() foundation.INSSet
One or more physical actions the user performs to manipulate the input.
See: https://developer.apple.com/documentation/GameController/GCPressedStateInput/sources
type GCQuaternion ¶
type GCQuaternion struct {
X float64 // The value for the x-axis of the quaternion.
Y float64 // The value for the y-axis of the quaternion.
Z float64 // The value for the z-axis of the quaternion.
W float64 // The value for the w-axis of the quaternion.
}
GCQuaternion - A quaternion that represents a controller’s measurement of attitude.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/GameController/GCQuaternion
type GCRacingWheel ¶
type GCRacingWheel struct {
objectivec.Object
}
An object that represents a physical racing wheel controller connected to a device.
Discovering racing wheels ¶
- GCRacingWheel.GCRacingWheelDidConnect: A notification that posts after a racing wheel controller connects to the device.
- GCRacingWheel.GCRacingWheelDidDisconnect: A notification that posts after a racing wheel controller disconnects from the device.
Getting events ¶
- GCRacingWheel.AcquireDeviceWithError: Starts receiving events from the racing wheel.
- GCRacingWheel.RelinquishDevice: Stops receiving events from the racing wheel.
- GCRacingWheel.Acquired: A Boolean value that indicates whether the racing wheel sends events to the app.
Accessing the controller profile ¶
- GCRacingWheel.WheelInput: The physical input profile for the racing wheel.
Creating snapshots ¶
- GCRacingWheel.Capture: Returns a snapshot of the racing wheel with its current element values.
- GCRacingWheel.Snapshot: A Boolean value that indicates whether the object is a snapshot of a racing wheel.
See: https://developer.apple.com/documentation/GameController/GCRacingWheel
func GCRacingWheelFromID ¶
func GCRacingWheelFromID(id objc.ID) GCRacingWheel
GCRacingWheelFromID constructs a GCRacingWheel from an objc.ID.
An object that represents a physical racing wheel controller connected to a device.
func NewGCRacingWheel ¶
func NewGCRacingWheel() GCRacingWheel
NewGCRacingWheel creates a new GCRacingWheel instance.
func (GCRacingWheel) AcquireDeviceWithError ¶
func (g GCRacingWheel) AcquireDeviceWithError() (bool, error)
Starts receiving events from the racing wheel.
Discussion ¶
Before invoking this method, the racing wheel doesn’t deliver events to your app. Since only one app may receive racing wheel events at a time, this method can fail to acquire the device.
See: https://developer.apple.com/documentation/GameController/GCRacingWheel/acquireDevice()
func (GCRacingWheel) Acquired ¶
func (g GCRacingWheel) Acquired() bool
A Boolean value that indicates whether the racing wheel sends events to the app.
See: https://developer.apple.com/documentation/GameController/GCRacingWheel/isAcquired
func (GCRacingWheel) Autorelease ¶
func (g GCRacingWheel) Autorelease() GCRacingWheel
Autorelease adds the receiver to the current autorelease pool.
func (GCRacingWheel) Capture ¶
func (g GCRacingWheel) Capture() IGCRacingWheel
Returns a snapshot of the racing wheel with its current element values.
Return Value ¶
A snapshot of the racing wheel.
See: https://developer.apple.com/documentation/GameController/GCRacingWheel/capture()
func (GCRacingWheel) GCRacingWheelDidConnect ¶
func (g GCRacingWheel) GCRacingWheelDidConnect() foundation.NSString
A notification that posts after a racing wheel controller connects to the device.
func (GCRacingWheel) GCRacingWheelDidDisconnect ¶
func (g GCRacingWheel) GCRacingWheelDidDisconnect() foundation.NSString
A notification that posts after a racing wheel controller disconnects from the device.
func (GCRacingWheel) HandlerQueue ¶
func (g GCRacingWheel) HandlerQueue() dispatch.Queue
The dispatch queue that the framework uses to call element value change handlers.
Discussion ¶
The default queue is the main queue. Set this property to another queue to asynchronously call value change handlers (see GCControllerAxisInput, GCControllerButtonInput, GCControllerDirectionPad, and GCMotion). For example, if you handle input on another queue, set this property when you first access the input device.
See: https://developer.apple.com/documentation/GameController/GCDevice/handlerQueue
func (GCRacingWheel) Init ¶
func (g GCRacingWheel) Init() GCRacingWheel
Init initializes the instance.
func (GCRacingWheel) PhysicalInputProfile ¶
func (g GCRacingWheel) PhysicalInputProfile() IGCPhysicalInputProfile
The device’s physical input profile, such as a controller’s extended gamepad.
See: https://developer.apple.com/documentation/GameController/GCDevice/physicalInputProfile
func (GCRacingWheel) ProductCategory ¶
func (g GCRacingWheel) ProductCategory() string
The product category that identifies the type of controller.
See: https://developer.apple.com/documentation/GameController/GCDevice/productCategory
func (GCRacingWheel) RelinquishDevice ¶
func (g GCRacingWheel) RelinquishDevice()
Stops receiving events from the racing wheel.
See: https://developer.apple.com/documentation/GameController/GCRacingWheel/relinquishDevice()
func (GCRacingWheel) SetHandlerQueue ¶
func (g GCRacingWheel) SetHandlerQueue(value dispatch.Queue)
func (GCRacingWheel) Snapshot ¶
func (g GCRacingWheel) Snapshot() bool
A Boolean value that indicates whether the object is a snapshot of a racing wheel.
Discussion ¶
If true, the racing wheel is a snapshot at a moment in time of a real device; otherwise, it’s an actual racing wheel.
See: https://developer.apple.com/documentation/GameController/GCRacingWheel/isSnapshot
func (GCRacingWheel) VendorName ¶
func (g GCRacingWheel) VendorName() string
The manufacturer-provided name for the device, or the user’s name for the device.
Discussion ¶
The value of this property may be `nil` and may not be unique. Use this property to present information about the device to the user.
See: https://developer.apple.com/documentation/GameController/GCDevice/vendorName
func (GCRacingWheel) WheelInput ¶
func (g GCRacingWheel) WheelInput() IGCRacingWheelInput
The physical input profile for the racing wheel.
See: https://developer.apple.com/documentation/GameController/GCRacingWheel/wheelInput
type GCRacingWheelClass ¶
type GCRacingWheelClass struct {
// contains filtered or unexported fields
}
func GetGCRacingWheelClass ¶
func GetGCRacingWheelClass() GCRacingWheelClass
GetGCRacingWheelClass returns the class object for GCRacingWheel.
func (GCRacingWheelClass) Alloc ¶
func (gc GCRacingWheelClass) Alloc() GCRacingWheel
Alloc allocates memory for a new instance of the class.
func (GCRacingWheelClass) Class ¶
func (gc GCRacingWheelClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
func (GCRacingWheelClass) ConnectedRacingWheels ¶
func (_GCRacingWheelClass GCRacingWheelClass) ConnectedRacingWheels() foundation.INSSet
The racing wheels connected to the device.
See: https://developer.apple.com/documentation/GameController/GCRacingWheel/connectedRacingWheels
type GCRacingWheelInput ¶
type GCRacingWheelInput struct {
GCRacingWheelInputState
}
A controller profile that supports a racing wheel.
Creating snapshots ¶
- GCRacingWheelInput.Capture: Returns a snapshot of the racing wheel inputs.
Polling for input ¶
- GCRacingWheelInput.NextInputState: Returns the next input state of the racing wheel from the queue.
See: https://developer.apple.com/documentation/GameController/GCRacingWheelInput
func GCRacingWheelInputFromID ¶
func GCRacingWheelInputFromID(id objc.ID) GCRacingWheelInput
GCRacingWheelInputFromID constructs a GCRacingWheelInput from an objc.ID.
A controller profile that supports a racing wheel.
func NewGCRacingWheelInput ¶
func NewGCRacingWheelInput() GCRacingWheelInput
NewGCRacingWheelInput creates a new GCRacingWheelInput instance.
func (GCRacingWheelInput) Autorelease ¶
func (g GCRacingWheelInput) Autorelease() GCRacingWheelInput
Autorelease adds the receiver to the current autorelease pool.
func (GCRacingWheelInput) Capture ¶
func (g GCRacingWheelInput) Capture() IGCRacingWheelInputState
Returns a snapshot of the racing wheel inputs.
Return Value ¶
A new instance containing the current state vector of the racing wheel input.
See: https://developer.apple.com/documentation/GameController/GCRacingWheelInput/capture()
func (GCRacingWheelInput) ElementValueDidChangeHandler ¶
func (g GCRacingWheelInput) ElementValueDidChangeHandler() VoidHandler
A block that the profile calls when an element’s value changes.
Discussion ¶
Use this property to get the latest state of the element. If multiple elements change, Game Controller invokes this block for each element that changes. The block’s parameters are:
element: The element whose value changes.
func (GCRacingWheelInput) Init ¶
func (g GCRacingWheelInput) Init() GCRacingWheelInput
Init initializes the instance.
func (GCRacingWheelInput) InputStateAvailableHandler ¶
func (g GCRacingWheelInput) InputStateAvailableHandler() GCDevicePhysicalInputHandler
The block that the profile calls when Game Controller adds an input state to the queue.
Discussion ¶
Set this property to track every element value change, not just the current value. When Game Controller invokes the handler, invoke the [NextInputState] method repeatedly to get all the buffered changes until the queue is empty.
To get just the current element value, use the [ElementValueDidChangeHandler] property instead.
func (GCRacingWheelInput) InputStateQueueDepth ¶
func (g GCRacingWheelInput) InputStateQueueDepth() int
The maximum number of input values that the queue stores.
Discussion ¶
When the queue reaches this limit, Game Controller starts removing the oldest input states from the queue. The default value for this property is `1` which indicates no buffering.
See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInput/inputStateQueueDepth
func (GCRacingWheelInput) NextInputState ¶
func (g GCRacingWheelInput) NextInputState() IGCRacingWheelInputState
Returns the next input state of the racing wheel from the queue.
Return Value ¶
The next input state in the queue or `nil` if the queue is empty.
Discussion ¶
This method removes the next input state from the queue.
See: https://developer.apple.com/documentation/GameController/GCRacingWheelInput/nextInputState()
func (GCRacingWheelInput) Queue ¶
func (g GCRacingWheelInput) Queue() dispatch.Queue
The dispatch queue that the system uses for callbacks.
Discussion ¶
Objects that conform to the GCDevicePhysicalInput protocol dispatch callbacks on the device’s [HandlerQueue] property by default. If you want to use a different dispatch queue, set this property to the preferred queue before you set callbacks.
See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInput/queue
func (GCRacingWheelInput) SetElementValueDidChangeHandler ¶
func (g GCRacingWheelInput) SetElementValueDidChangeHandler(value VoidHandler)
func (GCRacingWheelInput) SetInputStateAvailableHandler ¶
func (g GCRacingWheelInput) SetInputStateAvailableHandler(value GCDevicePhysicalInputHandler)
func (GCRacingWheelInput) SetInputStateQueueDepth ¶
func (g GCRacingWheelInput) SetInputStateQueueDepth(value int)
func (GCRacingWheelInput) SetQueue ¶
func (g GCRacingWheelInput) SetQueue(value dispatch.Queue)
type GCRacingWheelInputClass ¶
type GCRacingWheelInputClass struct {
// contains filtered or unexported fields
}
func GetGCRacingWheelInputClass ¶
func GetGCRacingWheelInputClass() GCRacingWheelInputClass
GetGCRacingWheelInputClass returns the class object for GCRacingWheelInput.
func (GCRacingWheelInputClass) Alloc ¶
func (gc GCRacingWheelInputClass) Alloc() GCRacingWheelInput
Alloc allocates memory for a new instance of the class.
func (GCRacingWheelInputClass) Class ¶
func (gc GCRacingWheelInputClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type GCRacingWheelInputState ¶
type GCRacingWheelInputState struct {
objectivec.Object
}
The input for the wheel of a racing wheel controller.
Getting input elements ¶
- GCRacingWheelInputState.Wheel: The controller’s wheel element.
- GCRacingWheelInputState.AcceleratorPedal: The controller’s accelerator pedal element.
- GCRacingWheelInputState.BrakePedal: The controller’s brake pedal element.
- GCRacingWheelInputState.ClutchPedal: The controller’s clutch element.
- GCRacingWheelInputState.Shifter: The controller’s gear shift element.
Accessing elements by name ¶
- GCRacingWheelInputState.GCInputSteeringWheel: The name of the steering wheel element.
- GCRacingWheelInputState.SetGCInputSteeringWheel
- GCRacingWheelInputState.GCInputShifter: The name of the shifter element.
- GCRacingWheelInputState.SetGCInputShifter
- GCRacingWheelInputState.GCInputPedalClutch: The name of the clutch element.
- GCRacingWheelInputState.SetGCInputPedalClutch
- GCRacingWheelInputState.GCInputPedalAccelerator: The name of the accelerator element.
- GCRacingWheelInputState.SetGCInputPedalAccelerator
- GCRacingWheelInputState.GCInputPedalBrake: The name of the brake element.
- GCRacingWheelInputState.SetGCInputPedalBrake
See: https://developer.apple.com/documentation/GameController/GCRacingWheelInputState
func GCRacingWheelInputStateFromID ¶
func GCRacingWheelInputStateFromID(id objc.ID) GCRacingWheelInputState
GCRacingWheelInputStateFromID constructs a GCRacingWheelInputState from an objc.ID.
The input for the wheel of a racing wheel controller.
func NewGCRacingWheelInputState ¶
func NewGCRacingWheelInputState() GCRacingWheelInputState
NewGCRacingWheelInputState creates a new GCRacingWheelInputState instance.
func (GCRacingWheelInputState) AcceleratorPedal ¶
func (g GCRacingWheelInputState) AcceleratorPedal() GCButtonElement
The controller’s accelerator pedal element.
See: https://developer.apple.com/documentation/GameController/GCRacingWheelInputState/acceleratorPedal
func (GCRacingWheelInputState) Autorelease ¶
func (g GCRacingWheelInputState) Autorelease() GCRacingWheelInputState
Autorelease adds the receiver to the current autorelease pool.
func (GCRacingWheelInputState) BrakePedal ¶
func (g GCRacingWheelInputState) BrakePedal() GCButtonElement
The controller’s brake pedal element.
See: https://developer.apple.com/documentation/GameController/GCRacingWheelInputState/brakePedal
func (GCRacingWheelInputState) ClutchPedal ¶
func (g GCRacingWheelInputState) ClutchPedal() GCButtonElement
The controller’s clutch element.
See: https://developer.apple.com/documentation/GameController/GCRacingWheelInputState/clutchPedal
func (GCRacingWheelInputState) Device ¶
func (g GCRacingWheelInputState) Device() GCDevice
The physical device that this profile represents.
See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/device
func (GCRacingWheelInputState) GCInputPedalAccelerator ¶
func (g GCRacingWheelInputState) GCInputPedalAccelerator() string
The name of the accelerator element.
See: https://developer.apple.com/documentation/gamecontroller/gcinputpedalaccelerator-6kg6u
func (GCRacingWheelInputState) GCInputPedalBrake ¶
func (g GCRacingWheelInputState) GCInputPedalBrake() string
The name of the brake element.
See: https://developer.apple.com/documentation/gamecontroller/gcinputpedalbrake-6wpdc
func (GCRacingWheelInputState) GCInputPedalClutch ¶
func (g GCRacingWheelInputState) GCInputPedalClutch() string
The name of the clutch element.
See: https://developer.apple.com/documentation/gamecontroller/gcinputpedalclutch-82gwe
func (GCRacingWheelInputState) GCInputShifter ¶
func (g GCRacingWheelInputState) GCInputShifter() string
The name of the shifter element.
See: https://developer.apple.com/documentation/gamecontroller/gcinputshifter-6miga
func (GCRacingWheelInputState) GCInputSteeringWheel ¶
func (g GCRacingWheelInputState) GCInputSteeringWheel() string
The name of the steering wheel element.
See: https://developer.apple.com/documentation/gamecontroller/gcinputsteeringwheel-26283
func (GCRacingWheelInputState) Init ¶
func (g GCRacingWheelInputState) Init() GCRacingWheelInputState
Init initializes the instance.
func (GCRacingWheelInputState) LastEventLatency ¶
func (g GCRacingWheelInputState) LastEventLatency() float64
The time in seconds between the last event and the current time.
Discussion ¶
Use this property as a minimum latency value that may not include latency that accrues on the device or when it transmits the event. If the host goes to sleep between when the event occurs and when you get this property, the value may not be accurate.
See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/lastEventLatency
func (GCRacingWheelInputState) LastEventTimestamp ¶
func (g GCRacingWheelInputState) LastEventTimestamp() float64
The time of the most recent event.
Discussion ¶
This property isn’t relative to any specific date and time. To determine the time between events, subtract a previous value of this property from the current value. You can also compare [LastEventTimestamp] properties of two different devices to determine which event occurs first.
func (GCRacingWheelInputState) ObjectForKeyedSubscript ¶
func (g GCRacingWheelInputState) ObjectForKeyedSubscript(key string) GCPhysicalInputElement
Returns the element that the key specifies.
key: A key that identifies an element.
Return Value ¶
The element that matches the key.
See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/subscript(_:)
func (GCRacingWheelInputState) SetGCInputPedalAccelerator ¶
func (g GCRacingWheelInputState) SetGCInputPedalAccelerator(value string)
func (GCRacingWheelInputState) SetGCInputPedalBrake ¶
func (g GCRacingWheelInputState) SetGCInputPedalBrake(value string)
func (GCRacingWheelInputState) SetGCInputPedalClutch ¶
func (g GCRacingWheelInputState) SetGCInputPedalClutch(value string)
func (GCRacingWheelInputState) SetGCInputShifter ¶
func (g GCRacingWheelInputState) SetGCInputShifter(value string)
func (GCRacingWheelInputState) SetGCInputSteeringWheel ¶
func (g GCRacingWheelInputState) SetGCInputSteeringWheel(value string)
func (GCRacingWheelInputState) Shifter ¶
func (g GCRacingWheelInputState) Shifter() IGCGearShifterElement
The controller’s gear shift element.
See: https://developer.apple.com/documentation/GameController/GCRacingWheelInputState/shifter
func (GCRacingWheelInputState) Wheel ¶
func (g GCRacingWheelInputState) Wheel() IGCSteeringWheelElement
The controller’s wheel element.
See: https://developer.apple.com/documentation/GameController/GCRacingWheelInputState/wheel
type GCRacingWheelInputStateClass ¶
type GCRacingWheelInputStateClass struct {
// contains filtered or unexported fields
}
func GetGCRacingWheelInputStateClass ¶
func GetGCRacingWheelInputStateClass() GCRacingWheelInputStateClass
GetGCRacingWheelInputStateClass returns the class object for GCRacingWheelInputState.
func (GCRacingWheelInputStateClass) Alloc ¶
func (gc GCRacingWheelInputStateClass) Alloc() GCRacingWheelInputState
Alloc allocates memory for a new instance of the class.
func (GCRacingWheelInputStateClass) Class ¶
func (gc GCRacingWheelInputStateClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type GCRelativeInput ¶
type GCRelativeInput interface {
objectivec.IObject
// A Boolean value that indicates whether the input provides analog values.
//
// See: https://developer.apple.com/documentation/GameController/GCRelativeInput/isAnalog
IsAnalog() bool
// The most recent amount of change in values that the profile records.
//
// See: https://developer.apple.com/documentation/GameController/GCRelativeInput/delta
Delta() float32
// The block that the profile calls when the element’s input changes.
//
// See: https://developer.apple.com/documentation/GameController/GCRelativeInput/deltaDidChangeHandler
DeltaDidChangeHandler() func(objc.ID, float32)
// A timestamp for when the profile reports the delta value.
//
// See: https://developer.apple.com/documentation/GameController/GCRelativeInput/lastDeltaTimestamp
LastDeltaTimestamp() float64
// The time in seconds between the current and the previous delta values.
//
// See: https://developer.apple.com/documentation/GameController/GCRelativeInput/lastDeltaLatency
LastDeltaLatency() float64
// One or more physical actions the user performs to manipulate the input.
//
// See: https://developer.apple.com/documentation/GameController/GCRelativeInput/sources
Sources() foundation.INSSet
}
The common properties of inputs that provide positions along an axis that are relative to the previous position.
See: https://developer.apple.com/documentation/GameController/GCRelativeInput
type GCRelativeInputObject ¶
type GCRelativeInputObject struct {
objectivec.Object
}
GCRelativeInputObject wraps an existing Objective-C object that conforms to the GCRelativeInput protocol.
func GCRelativeInputObjectFromID ¶
func GCRelativeInputObjectFromID(id objc.ID) GCRelativeInputObject
GCRelativeInputObjectFromID constructs a GCRelativeInputObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (GCRelativeInputObject) BaseObject ¶
func (o GCRelativeInputObject) BaseObject() objectivec.Object
func (GCRelativeInputObject) Delta ¶
func (o GCRelativeInputObject) Delta() float32
The most recent amount of change in values that the profile records.
See: https://developer.apple.com/documentation/GameController/GCRelativeInput/delta
func (GCRelativeInputObject) DeltaDidChangeHandler ¶
func (o GCRelativeInputObject) DeltaDidChangeHandler() func(objc.ID, float32)
The block that the profile calls when the element’s input changes.
See: https://developer.apple.com/documentation/GameController/GCRelativeInput/deltaDidChangeHandler
func (GCRelativeInputObject) IsAnalog ¶
func (o GCRelativeInputObject) IsAnalog() bool
A Boolean value that indicates whether the input provides analog values.
See: https://developer.apple.com/documentation/GameController/GCRelativeInput/isAnalog
func (GCRelativeInputObject) LastDeltaLatency ¶
func (o GCRelativeInputObject) LastDeltaLatency() float64
The time in seconds between the current and the previous delta values.
See: https://developer.apple.com/documentation/GameController/GCRelativeInput/lastDeltaLatency
func (GCRelativeInputObject) LastDeltaTimestamp ¶
func (o GCRelativeInputObject) LastDeltaTimestamp() float64
A timestamp for when the profile reports the delta value.
See: https://developer.apple.com/documentation/GameController/GCRelativeInput/lastDeltaTimestamp
func (GCRelativeInputObject) Sources ¶
func (o GCRelativeInputObject) Sources() foundation.INSSet
One or more physical actions the user performs to manipulate the input.
See: https://developer.apple.com/documentation/GameController/GCRelativeInput/sources
type GCRotationRate ¶
type GCRotationRate struct {
X float64 // The rotation rate around the x-axis in radians per second.
Y float64 // The rotation rate around the y-axis in radians per second.
Z float64 // The rotation rate around the z-axis in radians per second.
}
GCRotationRate - A structure that represents rotation rates around the x, y, and z axes.
[Full Topic] [Full Topic]: https://developer.apple.com/documentation/GameController/GCRotationRate
type GCSteeringWheelElement ¶
type GCSteeringWheelElement struct {
objectivec.Object
}
The element that represents the wheel of a racing wheel controller.
Getting the characteristics ¶
- GCSteeringWheelElement.MaximumDegreesOfRotation: The maximum number of degrees that the user can rotate the wheel.
See: https://developer.apple.com/documentation/GameController/GCSteeringWheelElement
func GCSteeringWheelElementFromID ¶
func GCSteeringWheelElementFromID(id objc.ID) GCSteeringWheelElement
GCSteeringWheelElementFromID constructs a GCSteeringWheelElement from an objc.ID.
The element that represents the wheel of a racing wheel controller.
func NewGCSteeringWheelElement ¶
func NewGCSteeringWheelElement() GCSteeringWheelElement
NewGCSteeringWheelElement creates a new GCSteeringWheelElement instance.
func (GCSteeringWheelElement) AbsoluteInput ¶
func (g GCSteeringWheelElement) AbsoluteInput() GCAxisInput
An input object that provides absolute axis values.
See: https://developer.apple.com/documentation/GameController/GCAxisElement/absoluteInput
func (GCSteeringWheelElement) Aliases ¶
func (g GCSteeringWheelElement) Aliases() foundation.INSSet
The element’s aliases to use when accessing it with the subscript notation.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElement/aliases
func (GCSteeringWheelElement) Autorelease ¶
func (g GCSteeringWheelElement) Autorelease() GCSteeringWheelElement
Autorelease adds the receiver to the current autorelease pool.
func (GCSteeringWheelElement) Init ¶
func (g GCSteeringWheelElement) Init() GCSteeringWheelElement
Init initializes the instance.
func (GCSteeringWheelElement) LocalizedName ¶
func (g GCSteeringWheelElement) LocalizedName() string
The localized name for the element.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElement/localizedName
func (GCSteeringWheelElement) MaximumDegreesOfRotation ¶
func (g GCSteeringWheelElement) MaximumDegreesOfRotation() float32
The maximum number of degrees that the user can rotate the wheel.
func (GCSteeringWheelElement) RelativeInput ¶
func (g GCSteeringWheelElement) RelativeInput() GCRelativeInput
An input object that provides relative axis values.
See: https://developer.apple.com/documentation/GameController/GCAxisElement/relativeInput
func (GCSteeringWheelElement) SfSymbolsName ¶
func (g GCSteeringWheelElement) SfSymbolsName() string
A system symbol for the element.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElement/sfSymbolsName
type GCSteeringWheelElementClass ¶
type GCSteeringWheelElementClass struct {
// contains filtered or unexported fields
}
func GetGCSteeringWheelElementClass ¶
func GetGCSteeringWheelElementClass() GCSteeringWheelElementClass
GetGCSteeringWheelElementClass returns the class object for GCSteeringWheelElement.
func (GCSteeringWheelElementClass) Alloc ¶
func (gc GCSteeringWheelElementClass) Alloc() GCSteeringWheelElement
Alloc allocates memory for a new instance of the class.
func (GCSteeringWheelElementClass) Class ¶
func (gc GCSteeringWheelElementClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type GCSwitchElement ¶
type GCSwitchElement interface {
objectivec.IObject
GCPhysicalInputElement
// The input object that provides the position of the switch.
//
// See: https://developer.apple.com/documentation/GameController/GCSwitchElement/positionInput
PositionInput() GCSwitchPositionInput
}
The common properties for an element that represents a switch.
See: https://developer.apple.com/documentation/GameController/GCSwitchElement
type GCSwitchElementName ¶
type GCSwitchElementName interface {
objectivec.IObject
GCPhysicalInputElementName
}
The name for an element that represents a switch.
See: https://developer.apple.com/documentation/GameController/GCSwitchElementName-c.protocol
type GCSwitchElementNameObject ¶
type GCSwitchElementNameObject struct {
objectivec.Object
}
GCSwitchElementNameObject wraps an existing Objective-C object that conforms to the GCSwitchElementName protocol.
func GCSwitchElementNameObjectFromID ¶
func GCSwitchElementNameObjectFromID(id objc.ID) GCSwitchElementNameObject
GCSwitchElementNameObjectFromID constructs a GCSwitchElementNameObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (GCSwitchElementNameObject) BaseObject ¶
func (o GCSwitchElementNameObject) BaseObject() objectivec.Object
type GCSwitchElementObject ¶
type GCSwitchElementObject struct {
objectivec.Object
}
GCSwitchElementObject wraps an existing Objective-C object that conforms to the GCSwitchElement protocol.
func GCSwitchElementObjectFromID ¶
func GCSwitchElementObjectFromID(id objc.ID) GCSwitchElementObject
GCSwitchElementObjectFromID constructs a GCSwitchElementObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (GCSwitchElementObject) Aliases ¶
func (o GCSwitchElementObject) Aliases() foundation.INSSet
The element’s aliases to use when accessing it with the subscript notation.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElement/aliases
func (GCSwitchElementObject) BaseObject ¶
func (o GCSwitchElementObject) BaseObject() objectivec.Object
func (GCSwitchElementObject) LocalizedName ¶
func (o GCSwitchElementObject) LocalizedName() string
The localized name for the element.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElement/localizedName
func (GCSwitchElementObject) PositionInput ¶
func (o GCSwitchElementObject) PositionInput() GCSwitchPositionInput
The input object that provides the position of the switch.
See: https://developer.apple.com/documentation/GameController/GCSwitchElement/positionInput
func (GCSwitchElementObject) SfSymbolsName ¶
func (o GCSwitchElementObject) SfSymbolsName() string
A system symbol for the element.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElement/sfSymbolsName
type GCSwitchPositionInput ¶
type GCSwitchPositionInput interface {
objectivec.IObject
// The range of possible values for the switch.
//
// See: https://developer.apple.com/documentation/GameController/GCSwitchPositionInput/positionRange
PositionRange() foundation.NSRange
// A Boolean value that indicates whether the position change is sequential.
//
// See: https://developer.apple.com/documentation/GameController/GCSwitchPositionInput/isSequential
IsSequential() bool
// A Boolean value that indicates whether the position value wraps when it reaches the range’s minimum or maximum value.
//
// See: https://developer.apple.com/documentation/GameController/GCSwitchPositionInput/canWrap
CanWrap() bool
// The position of the switch.
//
// See: https://developer.apple.com/documentation/GameController/GCSwitchPositionInput/position
Position() int
// The block that the profile calls when the value of the switch changes.
//
// See: https://developer.apple.com/documentation/GameController/GCSwitchPositionInput/positionDidChangeHandler
PositionDidChangeHandler() func(objc.ID, int64)
// A timestamp for when the profile reports the last position.
//
// See: https://developer.apple.com/documentation/GameController/GCSwitchPositionInput/lastPositionTimestamp
LastPositionTimestamp() float64
// The time in seconds between the current and previous positions.
//
// See: https://developer.apple.com/documentation/GameController/GCSwitchPositionInput/lastPositionLatency
LastPositionLatency() float64
// One or more physical actions the user performs to manipulate the input.
//
// See: https://developer.apple.com/documentation/GameController/GCSwitchPositionInput/sources
Sources() foundation.INSSet
}
The common properties of inputs that switch between two or more positions.
See: https://developer.apple.com/documentation/GameController/GCSwitchPositionInput
type GCSwitchPositionInputObject ¶
type GCSwitchPositionInputObject struct {
objectivec.Object
}
GCSwitchPositionInputObject wraps an existing Objective-C object that conforms to the GCSwitchPositionInput protocol.
func GCSwitchPositionInputObjectFromID ¶
func GCSwitchPositionInputObjectFromID(id objc.ID) GCSwitchPositionInputObject
GCSwitchPositionInputObjectFromID constructs a GCSwitchPositionInputObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (GCSwitchPositionInputObject) BaseObject ¶
func (o GCSwitchPositionInputObject) BaseObject() objectivec.Object
func (GCSwitchPositionInputObject) CanWrap ¶
func (o GCSwitchPositionInputObject) CanWrap() bool
A Boolean value that indicates whether the position value wraps when it reaches the range’s minimum or maximum value.
See: https://developer.apple.com/documentation/GameController/GCSwitchPositionInput/canWrap
func (GCSwitchPositionInputObject) IsSequential ¶
func (o GCSwitchPositionInputObject) IsSequential() bool
A Boolean value that indicates whether the position change is sequential.
See: https://developer.apple.com/documentation/GameController/GCSwitchPositionInput/isSequential
func (GCSwitchPositionInputObject) LastPositionLatency ¶
func (o GCSwitchPositionInputObject) LastPositionLatency() float64
The time in seconds between the current and previous positions.
See: https://developer.apple.com/documentation/GameController/GCSwitchPositionInput/lastPositionLatency
func (GCSwitchPositionInputObject) LastPositionTimestamp ¶
func (o GCSwitchPositionInputObject) LastPositionTimestamp() float64
A timestamp for when the profile reports the last position.
See: https://developer.apple.com/documentation/GameController/GCSwitchPositionInput/lastPositionTimestamp
func (GCSwitchPositionInputObject) Position ¶
func (o GCSwitchPositionInputObject) Position() int
The position of the switch.
See: https://developer.apple.com/documentation/GameController/GCSwitchPositionInput/position
func (GCSwitchPositionInputObject) PositionDidChangeHandler ¶
func (o GCSwitchPositionInputObject) PositionDidChangeHandler() func(objc.ID, int64)
The block that the profile calls when the value of the switch changes.
func (GCSwitchPositionInputObject) PositionRange ¶
func (o GCSwitchPositionInputObject) PositionRange() foundation.NSRange
The range of possible values for the switch.
See: https://developer.apple.com/documentation/GameController/GCSwitchPositionInput/positionRange
func (GCSwitchPositionInputObject) Sources ¶
func (o GCSwitchPositionInputObject) Sources() foundation.INSSet
One or more physical actions the user performs to manipulate the input.
See: https://developer.apple.com/documentation/GameController/GCSwitchPositionInput/sources
type GCSystemGestureState ¶
type GCSystemGestureState int
See: https://developer.apple.com/documentation/GameController/GCControllerElement/SystemGestureState
const ( // GCSystemGestureStateAlwaysReceive: A state that sends input to your app and a gesture recognizer simultaneously. GCSystemGestureStateAlwaysReceive GCSystemGestureState = 1 // GCSystemGestureStateDisabled: A state that sends input to your app directly and not to a gesture recognizer. GCSystemGestureStateDisabled GCSystemGestureState = 2 // GCSystemGestureStateEnabled: A state that sends input to your app only after a gesture recognizer doesn’t identify a gesture. GCSystemGestureStateEnabled GCSystemGestureState = 0 )
func (GCSystemGestureState) String ¶
func (e GCSystemGestureState) String() string
type GCTouchState ¶
type GCTouchState int
See: https://developer.apple.com/documentation/GameController/GCControllerTouchpad/TouchState-swift.enum
const ( // GCTouchStateDown: The user starts touching the surface. GCTouchStateDown GCTouchState = 1 // GCTouchStateMoving: The user continues touching the surface. GCTouchStateMoving GCTouchState = 2 // GCTouchStateUp: The user stops or isn’t touching the surface. GCTouchStateUp GCTouchState = 0 )
func (GCTouchState) String ¶
func (e GCTouchState) String() string
type GCTouchedStateInput ¶
type GCTouchedStateInput interface {
objectivec.IObject
// A Boolean value that indicates whether the user touches the button.
//
// See: https://developer.apple.com/documentation/GameController/GCTouchedStateInput/isTouched
IsTouched() bool
// The time of the most recent touch state change.
//
// See: https://developer.apple.com/documentation/GameController/GCTouchedStateInput/lastTouchedStateTimestamp
LastTouchedStateTimestamp() float64
// The time in seconds between the last touch state change and the current time.
//
// See: https://developer.apple.com/documentation/GameController/GCTouchedStateInput/lastTouchedStateLatency
LastTouchedStateLatency() float64
// A block that the element calls when its touch value changes.
//
// See: https://developer.apple.com/documentation/GameController/GCTouchedStateInput/touchedDidChangeHandler
TouchedDidChangeHandler() func(objc.ID, bool)
// One or more physical actions the user performs to manipulate the input.
//
// See: https://developer.apple.com/documentation/GameController/GCTouchedStateInput/sources
Sources() foundation.INSSet
}
The common properties for an element that has touch state input.
See: https://developer.apple.com/documentation/GameController/GCTouchedStateInput
type GCTouchedStateInputObject ¶
type GCTouchedStateInputObject struct {
objectivec.Object
}
GCTouchedStateInputObject wraps an existing Objective-C object that conforms to the GCTouchedStateInput protocol.
func GCTouchedStateInputObjectFromID ¶
func GCTouchedStateInputObjectFromID(id objc.ID) GCTouchedStateInputObject
GCTouchedStateInputObjectFromID constructs a GCTouchedStateInputObject from an objc.ID. The object is determined to conform to the protocol at runtime.
func (GCTouchedStateInputObject) BaseObject ¶
func (o GCTouchedStateInputObject) BaseObject() objectivec.Object
func (GCTouchedStateInputObject) IsTouched ¶
func (o GCTouchedStateInputObject) IsTouched() bool
A Boolean value that indicates whether the user touches the button.
See: https://developer.apple.com/documentation/GameController/GCTouchedStateInput/isTouched
func (GCTouchedStateInputObject) LastTouchedStateLatency ¶
func (o GCTouchedStateInputObject) LastTouchedStateLatency() float64
The time in seconds between the last touch state change and the current time.
See: https://developer.apple.com/documentation/GameController/GCTouchedStateInput/lastTouchedStateLatency
func (GCTouchedStateInputObject) LastTouchedStateTimestamp ¶
func (o GCTouchedStateInputObject) LastTouchedStateTimestamp() float64
The time of the most recent touch state change.
func (GCTouchedStateInputObject) Sources ¶
func (o GCTouchedStateInputObject) Sources() foundation.INSSet
One or more physical actions the user performs to manipulate the input.
See: https://developer.apple.com/documentation/GameController/GCTouchedStateInput/sources
func (GCTouchedStateInputObject) TouchedDidChangeHandler ¶
func (o GCTouchedStateInputObject) TouchedDidChangeHandler() func(objc.ID, bool)
A block that the element calls when its touch value changes.
See: https://developer.apple.com/documentation/GameController/GCTouchedStateInput/touchedDidChangeHandler
type GCUIEventTypes ¶
type GCUIEventTypes uint
See: https://developer.apple.com/documentation/GameController/GCUIEventTypes
const ( GCUIEventTypeGamepad GCUIEventTypes = 0 // GCUIEventTypeStylus: A constant that represents events from a stylus. GCUIEventTypeStylus GCUIEventTypes = 0 )
func (GCUIEventTypes) String ¶
func (e GCUIEventTypes) String() string
type GCXboxGamepad ¶
type GCXboxGamepad struct {
GCExtendedGamepad
}
A controller profile that supports the Xbox controller.
Overview ¶
The Xbox controller profile is similar to an extended game pad (GCExtendedGamepad), but has four paddle button elements.
[media-3830808]
Getting button inputs ¶
- GCXboxGamepad.PaddleButton1: The controller’s paddle 1 button element, which has a P1 label on the back of the controller.
- GCXboxGamepad.PaddleButton2: The paddle 2 button element, which has a P2 label on the back of the controller.
- GCXboxGamepad.PaddleButton3: The paddle 3 button element, which has a P3 label on the back of the controller.
- GCXboxGamepad.PaddleButton4: The paddle 4 button element, which has a P4 label on the back of the controller.
- GCXboxGamepad.ButtonShare: The share button on an Xbox Series X|S controller or later.
See: https://developer.apple.com/documentation/GameController/GCXboxGamepad
func GCXboxGamepadFromID ¶
func GCXboxGamepadFromID(id objc.ID) GCXboxGamepad
GCXboxGamepadFromID constructs a GCXboxGamepad from an objc.ID.
A controller profile that supports the Xbox controller.
func NewGCXboxGamepad ¶
func NewGCXboxGamepad() GCXboxGamepad
NewGCXboxGamepad creates a new GCXboxGamepad instance.
func (GCXboxGamepad) Autorelease ¶
func (g GCXboxGamepad) Autorelease() GCXboxGamepad
Autorelease adds the receiver to the current autorelease pool.
func (GCXboxGamepad) ButtonShare ¶
func (g GCXboxGamepad) ButtonShare() IGCControllerButtonInput
The share button on an Xbox Series X|S controller or later.
Discussion ¶
The system reserves the Share button for screenshot and video recording gestures. If you want to disable these gestures in your app, set the button’s [PreferredSystemGestureState] to GCControllerElement.SystemGestureState.disabled.
See: https://developer.apple.com/documentation/GameController/GCXboxGamepad/buttonShare
func (GCXboxGamepad) Init ¶
func (g GCXboxGamepad) Init() GCXboxGamepad
Init initializes the instance.
func (GCXboxGamepad) PaddleButton1 ¶
func (g GCXboxGamepad) PaddleButton1() IGCControllerButtonInput
The controller’s paddle 1 button element, which has a P1 label on the back of the controller.
See: https://developer.apple.com/documentation/GameController/GCXboxGamepad/paddleButton1
func (GCXboxGamepad) PaddleButton2 ¶
func (g GCXboxGamepad) PaddleButton2() IGCControllerButtonInput
The paddle 2 button element, which has a P2 label on the back of the controller.
See: https://developer.apple.com/documentation/GameController/GCXboxGamepad/paddleButton2
func (GCXboxGamepad) PaddleButton3 ¶
func (g GCXboxGamepad) PaddleButton3() IGCControllerButtonInput
The paddle 3 button element, which has a P3 label on the back of the controller.
See: https://developer.apple.com/documentation/GameController/GCXboxGamepad/paddleButton3
func (GCXboxGamepad) PaddleButton4 ¶
func (g GCXboxGamepad) PaddleButton4() IGCControllerButtonInput
The paddle 4 button element, which has a P4 label on the back of the controller.
See: https://developer.apple.com/documentation/GameController/GCXboxGamepad/paddleButton4
type GCXboxGamepadClass ¶
type GCXboxGamepadClass struct {
// contains filtered or unexported fields
}
func GetGCXboxGamepadClass ¶
func GetGCXboxGamepadClass() GCXboxGamepadClass
GetGCXboxGamepadClass returns the class object for GCXboxGamepad.
func (GCXboxGamepadClass) Alloc ¶
func (gc GCXboxGamepadClass) Alloc() GCXboxGamepad
Alloc allocates memory for a new instance of the class.
func (GCXboxGamepadClass) Class ¶
func (gc GCXboxGamepadClass) Class() objc.Class
Class returns the underlying Objective-C class pointer.
type IGCColor ¶
type IGCColor interface {
objectivec.IObject
// Creates a color with the specified red, green, and blue values.
InitWithRedGreenBlue(red float32, green float32, blue float32) GCColor
// The normalized value of the red component ranging from 0 to 1.
Red() float32
// The normalized value of the green component ranging from 0 to 1.
Green() float32
// The normalized value of the blue component ranging from 0 to 1.
Blue() float32
// The color of a device’s light.
Color() IGCColor
SetColor(value IGCColor)
EncodeWithCoder(coder foundation.INSCoder)
}
An interface definition for the GCColor class.
Creating colors ¶
- [IGCColor.InitWithRedGreenBlue]: Creates a color with the specified red, green, and blue values.
Setting color values ¶
- [IGCColor.Red]: The normalized value of the red component ranging from 0 to 1.
- [IGCColor.Green]: The normalized value of the green component ranging from 0 to 1.
- [IGCColor.Blue]: The normalized value of the blue component ranging from 0 to 1.
See: https://developer.apple.com/documentation/GameController/GCColor
type IGCController ¶
type IGCController interface {
objectivec.IObject
GCDevice
// A notification that posts after a controller connects to the device.
GCControllerDidConnect() foundation.NSString
// A notification that posts after a controller disconnects from the device.
GCControllerDidDisconnect() foundation.NSString
// A notification that posts when a controller becomes the current controller.
GCControllerDidBecomeCurrent() foundation.NSString
// A notification that posts when a controller stops being the current controller.
GCControllerDidStopBeingCurrent() foundation.NSString
// A Boolean value that indicates whether the controller closely integrates with the device.
AttachedToDevice() bool
// The input profile for the controller.
Input() IGCControllerLiveInput
// The extended gamepad profile.
ExtendedGamepad() IGCExtendedGamepad
// The micro gamepad profile.
MicroGamepad() IGCMicroGamepad
// The motion input profile.
Motion() IGCMotion
// The player index for the controller.
PlayerIndex() GCControllerPlayerIndex
SetPlayerIndex(value GCControllerPlayerIndex)
// The controller’s battery information.
Battery() IGCDeviceBattery
// The controller’s haptics information.
Haptics() IGCDeviceHaptics
// The controller’s light settings.
Light() IGCDeviceLight
// Returns a snapshot of the controller with its current element values.
Capture() IGCController
// A Boolean value that indicates whether the controller is a snapshot of a controller.
Snapshot() bool
// The controller’s left thumbstick element.
LeftThumbstick() IGCControllerDirectionPad
SetLeftThumbstick(value IGCControllerDirectionPad)
// The block that the profile calls when an element’s value changes.
ValueChangedHandler() GCExtendedGamepadValueChangedHandler
SetValueChangedHandler(value GCExtendedGamepadValueChangedHandler)
}
An interface definition for the GCController class.
Discovering controllers ¶
- [IGCController.GCControllerDidConnect]: A notification that posts after a controller connects to the device.
- [IGCController.GCControllerDidDisconnect]: A notification that posts after a controller disconnects from the device.
Handling multiple controllers ¶
- [IGCController.GCControllerDidBecomeCurrent]: A notification that posts when a controller becomes the current controller.
- [IGCController.GCControllerDidStopBeingCurrent]: A notification that posts when a controller stops being the current controller.
Inspecting a controller ¶
- [IGCController.AttachedToDevice]: A Boolean value that indicates whether the controller closely integrates with the device.
Accessing controller input ¶
- [IGCController.Input]: The input profile for the controller.
Accessing controller profiles ¶
- [IGCController.ExtendedGamepad]: The extended gamepad profile.
- [IGCController.MicroGamepad]: The micro gamepad profile.
- [IGCController.Motion]: The motion input profile.
Identifying controllers and displaying a player index ¶
- [IGCController.PlayerIndex]: The player index for the controller.
- [IGCController.SetPlayerIndex]
Accessing battery, haptics, and light objects ¶
- [IGCController.Battery]: The controller’s battery information.
- [IGCController.Haptics]: The controller’s haptics information.
- [IGCController.Light]: The controller’s light settings.
Creating snapshots ¶
- [IGCController.Capture]: Returns a snapshot of the controller with its current element values.
- [IGCController.Snapshot]: A Boolean value that indicates whether the controller is a snapshot of a controller.
See: https://developer.apple.com/documentation/GameController/GCController
type IGCControllerAxisInput ¶
type IGCControllerAxisInput interface {
IGCControllerElement
// The current value of the axis.
Value() float32
// The block that the element calls when the user changes the axis value.
ValueChangedHandler() GCControllerAxisValueChangedHandler
SetValueChangedHandler(value GCControllerAxisValueChangedHandler)
}
An interface definition for the GCControllerAxisInput class.
Accessing the input values ¶
- [IGCControllerAxisInput.Value]: The current value of the axis.
Getting change information ¶
- [IGCControllerAxisInput.ValueChangedHandler]: The block that the element calls when the user changes the axis value.
- [IGCControllerAxisInput.SetValueChangedHandler]
See: https://developer.apple.com/documentation/GameController/GCControllerAxisInput
type IGCControllerButtonInput ¶
type IGCControllerButtonInput interface {
IGCControllerElement
// A Boolean value that indicates whether the user is touching the button.
Touched() bool
// A Boolean value that indicates whether the user is pressing the button.
Pressed() bool
// The level of pressure the user is applying to the button.
Value() float32
// The block that the element calls when the user touches the button.
TouchedChangedHandler() GCControllerButtonTouchedChangedHandler
SetTouchedChangedHandler(value GCControllerButtonTouchedChangedHandler)
// The block that the element calls when the user presses or releases the button.
PressedChangedHandler() GCControllerButtonValueChangedHandler
SetPressedChangedHandler(value GCControllerButtonValueChangedHandler)
// The block that the element calls when the user changes the level of pressure on the button.
ValueChangedHandler() GCControllerButtonValueChangedHandler
SetValueChangedHandler(value GCControllerButtonValueChangedHandler)
}
An interface definition for the GCControllerButtonInput class.
Accessing input values ¶
- [IGCControllerButtonInput.Touched]: A Boolean value that indicates whether the user is touching the button.
- [IGCControllerButtonInput.Pressed]: A Boolean value that indicates whether the user is pressing the button.
- [IGCControllerButtonInput.Value]: The level of pressure the user is applying to the button.
Getting change information ¶
- [IGCControllerButtonInput.TouchedChangedHandler]: The block that the element calls when the user touches the button.
- [IGCControllerButtonInput.SetTouchedChangedHandler]
- [IGCControllerButtonInput.PressedChangedHandler]: The block that the element calls when the user presses or releases the button.
- [IGCControllerButtonInput.SetPressedChangedHandler]
- [IGCControllerButtonInput.ValueChangedHandler]: The block that the element calls when the user changes the level of pressure on the button.
- [IGCControllerButtonInput.SetValueChangedHandler]
See: https://developer.apple.com/documentation/GameController/GCControllerButtonInput
type IGCControllerDirectionPad ¶
type IGCControllerDirectionPad interface {
IGCControllerElement
// The x-axis element of the directional pad.
XAxis() IGCControllerAxisInput
// The y-axis element of the directional pad.
YAxis() IGCControllerAxisInput
// The button element that changes the positive x-axis.
Right() IGCControllerButtonInput
// The button element that changes the negative x-axis.
Left() IGCControllerButtonInput
// The button element that changes the positive y-axis.
Up() IGCControllerButtonInput
// The button element used for the negative y-axis direction.
Down() IGCControllerButtonInput
// The block that the directional pad calls when the user changes its values.
ValueChangedHandler() GCControllerDirectionPadValueChangedHandler
SetValueChangedHandler(value GCControllerDirectionPadValueChangedHandler)
// Sets the input values of a snapshot of a directional pad.
SetValueForXAxisYAxis(xAxis float32, yAxis float32)
}
An interface definition for the GCControllerDirectionPad class.
Accessing values using the axes ¶
- [IGCControllerDirectionPad.XAxis]: The x-axis element of the directional pad.
- [IGCControllerDirectionPad.YAxis]: The y-axis element of the directional pad.
Accessing values using directional buttons ¶
- [IGCControllerDirectionPad.Right]: The button element that changes the positive x-axis.
- [IGCControllerDirectionPad.Left]: The button element that changes the negative x-axis.
- [IGCControllerDirectionPad.Up]: The button element that changes the positive y-axis.
- [IGCControllerDirectionPad.Down]: The button element used for the negative y-axis direction.
Getting change information ¶
- [IGCControllerDirectionPad.ValueChangedHandler]: The block that the directional pad calls when the user changes its values.
- [IGCControllerDirectionPad.SetValueChangedHandler]
Setting snapshot values ¶
- [IGCControllerDirectionPad.SetValueForXAxisYAxis]: Sets the input values of a snapshot of a directional pad.
See: https://developer.apple.com/documentation/GameController/GCControllerDirectionPad
type IGCControllerElement ¶
type IGCControllerElement interface {
objectivec.IObject
// A Boolean value that indicates whether the element provides analog data.
Analog() bool
// The localized name for the element or the remapped element.
LocalizedName() string
SetLocalizedName(value string)
// The element’s localized name, not the remapped name.
UnmappedLocalizedName() string
SetUnmappedLocalizedName(value string)
// A system symbol for the element or the remapped element.
SfSymbolsName() string
SetSfSymbolsName(value string)
// The element’s system symbol, not the remapped symbol.
UnmappedSfSymbolsName() string
SetUnmappedSfSymbolsName(value string)
// The element’s aliases you use when accessing it with the subscript notation.
Aliases() foundation.INSSet
// The enclosing element for this element.
Collection() IGCControllerElement
// A Boolean value that indicates whether the user binds the element to a system gesture.
BoundToSystemGesture() bool
// The preferred state for handling input when the user binds the element to a system gesture.
PreferredSystemGestureState() GCSystemGestureState
SetPreferredSystemGestureState(value GCSystemGestureState)
}
An interface definition for the GCControllerElement class.
Accessing input values ¶
- [IGCControllerElement.Analog]: A Boolean value that indicates whether the element provides analog data.
Getting a localized name ¶
- [IGCControllerElement.LocalizedName]: The localized name for the element or the remapped element.
- [IGCControllerElement.SetLocalizedName]
- [IGCControllerElement.UnmappedLocalizedName]: The element’s localized name, not the remapped name.
- [IGCControllerElement.SetUnmappedLocalizedName]
Displaying a symbol ¶
- [IGCControllerElement.SfSymbolsName]: A system symbol for the element or the remapped element.
- [IGCControllerElement.SetSfSymbolsName]
- [IGCControllerElement.UnmappedSfSymbolsName]: The element’s system symbol, not the remapped symbol.
- [IGCControllerElement.SetUnmappedSfSymbolsName]
Accessing elements by key ¶
- [IGCControllerElement.Aliases]: The element’s aliases you use when accessing it with the subscript notation.
Getting the containing element ¶
- [IGCControllerElement.Collection]: The enclosing element for this element.
Handling system gesture input ¶
- [IGCControllerElement.BoundToSystemGesture]: A Boolean value that indicates whether the user binds the element to a system gesture.
- [IGCControllerElement.PreferredSystemGestureState]: The preferred state for handling input when the user binds the element to a system gesture.
- [IGCControllerElement.SetPreferredSystemGestureState]
See: https://developer.apple.com/documentation/GameController/GCControllerElement
type IGCControllerInputState ¶
type IGCControllerInputState interface {
objectivec.IObject
GCDevicePhysicalInputState
// The input profile for the controller.
Input() IGCControllerLiveInput
SetInput(value IGCControllerLiveInput)
}
An interface definition for the GCControllerInputState class.
See: https://developer.apple.com/documentation/GameController/GCControllerInputState
type IGCControllerLiveInput ¶
type IGCControllerLiveInput interface {
IGCControllerInputState
// Returns the next device input state from the queue.
NextInputState() IGCControllerInputState
// Returns a snapshot of the physical device inputs.
Capture() IGCControllerInputState
// The live input of a controller without any system-level remapping of the controls.
UnmappedInput() IGCControllerLiveInput
}
An interface definition for the GCControllerLiveInput class.
Handling device input ¶
- [IGCControllerLiveInput.NextInputState]: Returns the next device input state from the queue.
- [IGCControllerLiveInput.Capture]: Returns a snapshot of the physical device inputs.
Remapping controls ¶
- [IGCControllerLiveInput.UnmappedInput]: The live input of a controller without any system-level remapping of the controls.
See: https://developer.apple.com/documentation/GameController/GCControllerLiveInput
type IGCControllerTouchpad ¶
type IGCControllerTouchpad interface {
IGCControllerElement
// The element that represents the state of the user’s touch on the surface of the touchpad.
TouchSurface() IGCControllerDirectionPad
// The element that represents the button component on the touchpad.
Button() IGCControllerButtonInput
// The state of the user’s touch on the surface of the touchpad.
TouchState() GCTouchState
// A Boolean value that determines whether the touch values are absolute or relative.
ReportsAbsoluteTouchSurfaceValues() bool
SetReportsAbsoluteTouchSurfaceValues(value bool)
// The block that the element calls when the user begins touching the touchpad.
TouchDown() GCControllerTouchpadHandler
SetTouchDown(value GCControllerTouchpadHandler)
// The block that the element calls when the user continues touching the touchpad, not when the user begins or ends touching the touchpad.
TouchMoved() GCControllerTouchpadHandler
SetTouchMoved(value GCControllerTouchpadHandler)
// The block that the element calls when the user finishes touching the touchpad.
TouchUp() GCControllerTouchpadHandler
SetTouchUp(value GCControllerTouchpadHandler)
// Sets the input values of a snapshot of a touchpad.
SetValueForXAxisYAxisTouchDownButtonValue(xAxis float32, yAxis float32, touchDown bool, buttonValue float32)
}
An interface definition for the GCControllerTouchpad class.
Getting the subelements ¶
- [IGCControllerTouchpad.TouchSurface]: The element that represents the state of the user’s touch on the surface of the touchpad.
- [IGCControllerTouchpad.Button]: The element that represents the button component on the touchpad.
Accessing the input values ¶
- [IGCControllerTouchpad.TouchState]: The state of the user’s touch on the surface of the touchpad.
- [IGCControllerTouchpad.ReportsAbsoluteTouchSurfaceValues]: A Boolean value that determines whether the touch values are absolute or relative.
- [IGCControllerTouchpad.SetReportsAbsoluteTouchSurfaceValues]
Getting change information ¶
- [IGCControllerTouchpad.TouchDown]: The block that the element calls when the user begins touching the touchpad.
- [IGCControllerTouchpad.SetTouchDown]
- [IGCControllerTouchpad.TouchMoved]: The block that the element calls when the user continues touching the touchpad, not when the user begins or ends touching the touchpad.
- [IGCControllerTouchpad.SetTouchMoved]
- [IGCControllerTouchpad.TouchUp]: The block that the element calls when the user finishes touching the touchpad.
- [IGCControllerTouchpad.SetTouchUp]
Setting snapshot values ¶
- [IGCControllerTouchpad.SetValueForXAxisYAxisTouchDownButtonValue]: Sets the input values of a snapshot of a touchpad.
See: https://developer.apple.com/documentation/GameController/GCControllerTouchpad
type IGCDeviceBattery ¶
type IGCDeviceBattery interface {
objectivec.IObject
// The charge level of a device’s battery.
BatteryLevel() float32
// The state of a device’s battery.
BatteryState() GCDeviceBatteryState
}
An interface definition for the GCDeviceBattery class.
Getting the battery level and state ¶
- [IGCDeviceBattery.BatteryLevel]: The charge level of a device’s battery.
- [IGCDeviceBattery.BatteryState]: The state of a device’s battery.
See: https://developer.apple.com/documentation/GameController/GCDeviceBattery
type IGCDeviceCursor ¶
type IGCDeviceCursor interface {
IGCControllerDirectionPad
}
An interface definition for the GCDeviceCursor class.
See: https://developer.apple.com/documentation/GameController/GCDeviceCursor
type IGCDeviceHaptics ¶
type IGCDeviceHaptics interface {
objectivec.IObject
// Creates a haptics engine with the specified locality.
CreateEngineWithLocality(locality GCHapticsLocality) unsafe.Pointer
// An infinite duration for a haptics event.
GCHapticDurationInfinite() float32
// The locations of haptic actuators on the device.
SupportedLocalities() foundation.INSSet
// A Boolean value that indicates whether the device supports haptic event playback.
SupportsHaptics() bool
SetSupportsHaptics(value bool)
}
An interface definition for the GCDeviceHaptics class.
Creating a haptics engine ¶
- [IGCDeviceHaptics.CreateEngineWithLocality]: Creates a haptics engine with the specified locality.
- [IGCDeviceHaptics.GCHapticDurationInfinite]: An infinite duration for a haptics event.
Getting the localities ¶
- [IGCDeviceHaptics.SupportedLocalities]: The locations of haptic actuators on the device.
See: https://developer.apple.com/documentation/GameController/GCDeviceHaptics
type IGCDeviceLight ¶
type IGCDeviceLight interface {
objectivec.IObject
// The color of a device’s light.
Color() IGCColor
SetColor(value IGCColor)
}
An interface definition for the GCDeviceLight class.
Getting the light’s color ¶
- [IGCDeviceLight.Color]: The color of a device’s light.
- [IGCDeviceLight.SetColor]
See: https://developer.apple.com/documentation/GameController/GCDeviceLight
type IGCDirectionalGamepad ¶
type IGCDirectionalGamepad interface {
IGCMicroGamepad
// A Boolean value that indicates whether the element provides analog data.
IsAnalog() bool
SetIsAnalog(value bool)
}
An interface definition for the GCDirectionalGamepad class.
See: https://developer.apple.com/documentation/GameController/GCDirectionalGamepad
type IGCDualSenseAdaptiveTrigger ¶
type IGCDualSenseAdaptiveTrigger interface {
IGCControllerButtonInput
// The current configuration of the adaptive trigger.
Mode() GCDualSenseAdaptiveTriggerMode
// Sets the mode to off and stops any trigger effect.
SetModeOff()
// Sets the mode to provide feedback when the user depresses the trigger at the start position or at a greater value.
SetModeFeedbackWithStartPositionResistiveStrength(startPosition float32, resistiveStrength float32)
// Sets the mode to provide feedback with the specified strengths for each possible trigger position.
SetModeFeedbackWithResistiveStrengths(positionalResistiveStrengths GCDualSenseAdaptiveTriggerPositionalResistiveStrengths)
// Sets the mode to provide feedback when the user depresses the trigger between the start and the end positions.
SetModeWeaponWithStartPositionEndPositionResistiveStrength(startPosition float32, endPosition float32, resistiveStrength float32)
// Sets the mode to vibrate when the user depresses the trigger at the start position or at a greater value.
SetModeVibrationWithStartPositionAmplitudeFrequency(startPosition float32, amplitude float32, frequency float32)
// Sets the mode to vibrate with the specified amplitudes for each possible trigger position.
SetModeVibrationWithAmplitudesFrequency(positionalAmplitudes GCDualSenseAdaptiveTriggerPositionalAmplitudes, frequency float32)
// Sets the mode to provide feedback when the user tilts the trigger between the start and the end positions.
SetModeSlopeFeedbackWithStartPositionEndPositionStartStrengthEndStrength(startPosition float32, endPosition float32, startStrength float32, endStrength float32)
// The position of the trigger’s arm.
ArmPosition() float32
// The current status of the adaptive trigger and whether it’s applying effects.
Status() GCDualSenseAdaptiveTriggerStatus
}
An interface definition for the GCDualSenseAdaptiveTrigger class.
Getting the mode ¶
- [IGCDualSenseAdaptiveTrigger.Mode]: The current configuration of the adaptive trigger.
- [IGCDualSenseAdaptiveTrigger.SetModeOff]: Sets the mode to off and stops any trigger effect.
Configuring the trigger ¶
- [IGCDualSenseAdaptiveTrigger.SetModeFeedbackWithStartPositionResistiveStrength]: Sets the mode to provide feedback when the user depresses the trigger at the start position or at a greater value.
- [IGCDualSenseAdaptiveTrigger.SetModeFeedbackWithResistiveStrengths]: Sets the mode to provide feedback with the specified strengths for each possible trigger position.
- [IGCDualSenseAdaptiveTrigger.SetModeWeaponWithStartPositionEndPositionResistiveStrength]: Sets the mode to provide feedback when the user depresses the trigger between the start and the end positions.
- [IGCDualSenseAdaptiveTrigger.SetModeVibrationWithStartPositionAmplitudeFrequency]: Sets the mode to vibrate when the user depresses the trigger at the start position or at a greater value.
- [IGCDualSenseAdaptiveTrigger.SetModeVibrationWithAmplitudesFrequency]: Sets the mode to vibrate with the specified amplitudes for each possible trigger position.
- [IGCDualSenseAdaptiveTrigger.SetModeSlopeFeedbackWithStartPositionEndPositionStartStrengthEndStrength]: Sets the mode to provide feedback when the user tilts the trigger between the start and the end positions.
Getting the arm position ¶
- [IGCDualSenseAdaptiveTrigger.ArmPosition]: The position of the trigger’s arm.
Checking the status ¶
- [IGCDualSenseAdaptiveTrigger.Status]: The current status of the adaptive trigger and whether it’s applying effects.
See: https://developer.apple.com/documentation/GameController/GCDualSenseAdaptiveTrigger
type IGCDualSenseGamepad ¶
type IGCDualSenseGamepad interface {
IGCExtendedGamepad
// The button element on the touchpad of the controller.
TouchpadButton() IGCControllerButtonInput
// The location of the player’s primary finger on the touchpad.
TouchpadPrimary() IGCControllerDirectionPad
// The location of the player’s secondary finger on the touchpad.
TouchpadSecondary() IGCControllerDirectionPad
}
An interface definition for the GCDualSenseGamepad class.
Getting button input ¶
- [IGCDualSenseGamepad.TouchpadButton]: The button element on the touchpad of the controller.
Tracking finger locations ¶
- [IGCDualSenseGamepad.TouchpadPrimary]: The location of the player’s primary finger on the touchpad.
- [IGCDualSenseGamepad.TouchpadSecondary]: The location of the player’s secondary finger on the touchpad.
See: https://developer.apple.com/documentation/GameController/GCDualSenseGamepad
type IGCDualShockGamepad ¶
type IGCDualShockGamepad interface {
IGCExtendedGamepad
// The button element on the touchpad of the controller.
TouchpadButton() IGCControllerButtonInput
// The location of the player’s primary finger on the touchpad.
TouchpadPrimary() IGCControllerDirectionPad
// The location of the player’s secondary finger on the touchpad.
TouchpadSecondary() IGCControllerDirectionPad
}
An interface definition for the GCDualShockGamepad class.
Getting button input ¶
- [IGCDualShockGamepad.TouchpadButton]: The button element on the touchpad of the controller.
Tracking finger locations ¶
- [IGCDualShockGamepad.TouchpadPrimary]: The location of the player’s primary finger on the touchpad.
- [IGCDualShockGamepad.TouchpadSecondary]: The location of the player’s secondary finger on the touchpad.
See: https://developer.apple.com/documentation/GameController/GCDualShockGamepad
type IGCEventViewController ¶
type IGCEventViewController interface {
appkit.INSViewController
// A Boolean value that indicates whether the system delivers game controller input to profile objects or to views using the responder chain.
ControllerUserInteractionEnabled() bool
SetControllerUserInteractionEnabled(value bool)
}
An interface definition for the GCEventViewController class.
Delivering game controller inputs ¶
- [IGCEventViewController.ControllerUserInteractionEnabled]: A Boolean value that indicates whether the system delivers game controller input to profile objects or to views using the responder chain.
- [IGCEventViewController.SetControllerUserInteractionEnabled]
See: https://developer.apple.com/documentation/GameController/GCEventViewController
type IGCExtendedGamepad ¶
type IGCExtendedGamepad interface {
IGCPhysicalInputProfile
// The controller for the profile.
Controller() IGCController
// The block that the profile calls when an element’s value changes.
ValueChangedHandler() GCExtendedGamepadValueChangedHandler
SetValueChangedHandler(value GCExtendedGamepadValueChangedHandler)
// The controller’s left shoulder button element.
LeftShoulder() IGCControllerButtonInput
// The controller’s right shoulder button element.
RightShoulder() IGCControllerButtonInput
// The controller’s left trigger element.
LeftTrigger() IGCControllerButtonInput
// The controller’s right trigger element.
RightTrigger() IGCControllerButtonInput
// The primary menu button element that players use to enter the main menu and pause the game.
ButtonMenu() IGCControllerButtonInput
// The controller’s secondary menu button element.
ButtonOptions() IGCControllerButtonInput
// The main menu button element that players use to enter the secondary menu and pause the game.
ButtonHome() IGCControllerButtonInput
// The bottom face button that uses or another indicator as its label.
ButtonA() IGCControllerButtonInput
// The right face button that uses or another indicator as its label.
ButtonB() IGCControllerButtonInput
// The left face button that uses or another indicator as its label.
ButtonX() IGCControllerButtonInput
// The top face button that uses or another indicator as its label.
ButtonY() IGCControllerButtonInput
// The controller’s directional pad element.
Dpad() IGCControllerDirectionPad
// The controller’s left thumbstick element.
LeftThumbstick() IGCControllerDirectionPad
// The controller’s right thumbstick element.
RightThumbstick() IGCControllerDirectionPad
// The button on the left thumbstick of the controller.
LeftThumbstickButton() IGCControllerButtonInput
// The button on the right thumbstick of the controller.
RightThumbstickButton() IGCControllerButtonInput
// Copies the input values from a specified extended gamepad to a snapshot of an extended gamepad.
SetStateFromExtendedGamepad(extendedGamepad IGCExtendedGamepad)
}
An interface definition for the GCExtendedGamepad class.
Getting the controller ¶
- [IGCExtendedGamepad.Controller]: The controller for the profile.
Getting change information ¶
- [IGCExtendedGamepad.ValueChangedHandler]: The block that the profile calls when an element’s value changes.
- [IGCExtendedGamepad.SetValueChangedHandler]
Getting shoulder button inputs ¶
- [IGCExtendedGamepad.LeftShoulder]: The controller’s left shoulder button element.
- [IGCExtendedGamepad.RightShoulder]: The controller’s right shoulder button element.
Getting trigger inputs ¶
- [IGCExtendedGamepad.LeftTrigger]: The controller’s left trigger element.
- [IGCExtendedGamepad.RightTrigger]: The controller’s right trigger element.
Getting face button inputs ¶
- [IGCExtendedGamepad.ButtonMenu]: The primary menu button element that players use to enter the main menu and pause the game.
- [IGCExtendedGamepad.ButtonOptions]: The controller’s secondary menu button element.
- [IGCExtendedGamepad.ButtonHome]: The main menu button element that players use to enter the secondary menu and pause the game.
- [IGCExtendedGamepad.ButtonA]: The bottom face button that uses or another indicator as its label.
- [IGCExtendedGamepad.ButtonB]: The right face button that uses or another indicator as its label.
- [IGCExtendedGamepad.ButtonX]: The left face button that uses or another indicator as its label.
- [IGCExtendedGamepad.ButtonY]: The top face button that uses or another indicator as its label.
Getting directional pad inputs ¶
- [IGCExtendedGamepad.Dpad]: The controller’s directional pad element.
Getting thumbstick and thumbstick button inputs ¶
- [IGCExtendedGamepad.LeftThumbstick]: The controller’s left thumbstick element.
- [IGCExtendedGamepad.RightThumbstick]: The controller’s right thumbstick element.
- [IGCExtendedGamepad.LeftThumbstickButton]: The button on the left thumbstick of the controller.
- [IGCExtendedGamepad.RightThumbstickButton]: The button on the right thumbstick of the controller.
Setting snapshot values ¶
- [IGCExtendedGamepad.SetStateFromExtendedGamepad]: Copies the input values from a specified extended gamepad to a snapshot of an extended gamepad.
See: https://developer.apple.com/documentation/GameController/GCExtendedGamepad
type IGCGearShifterElement ¶
type IGCGearShifterElement interface {
objectivec.IObject
GCPhysicalInputElement
// The input object for a pattern gear shift.
PatternInput() GCSwitchPositionInput
// The input object for a sequential gear shift.
SequentialInput() GCRelativeInput
}
An interface definition for the GCGearShifterElement class.
Accessing input values ¶
- [IGCGearShifterElement.PatternInput]: The input object for a pattern gear shift.
- [IGCGearShifterElement.SequentialInput]: The input object for a sequential gear shift.
See: https://developer.apple.com/documentation/GameController/GCGearShifterElement
type IGCKeyboard ¶
type IGCKeyboard interface {
objectivec.IObject
GCDevice
// A notification that posts after a keyboard connects to the device.
GCKeyboardDidConnect() foundation.NSString
// A notification that posts after a single keyboard, or the last of multiple keyboards, disconnects from the device.
GCKeyboardDidDisconnect() foundation.NSString
// The controller profile for the keyboard.
KeyboardInput() IGCKeyboardInput
}
An interface definition for the GCKeyboard class.
Discovering keyboards ¶
- [IGCKeyboard.GCKeyboardDidConnect]: A notification that posts after a keyboard connects to the device.
- [IGCKeyboard.GCKeyboardDidDisconnect]: A notification that posts after a single keyboard, or the last of multiple keyboards, disconnects from the device.
Getting input values ¶
- [IGCKeyboard.KeyboardInput]: The controller profile for the keyboard.
See: https://developer.apple.com/documentation/GameController/GCKeyboard
type IGCKeyboardInput ¶
type IGCKeyboardInput interface {
IGCPhysicalInputProfile
// The block that the profile calls when the user presses a key.
KeyChangedHandler() GCKeyboardValueChangedHandler
SetKeyChangedHandler(value GCKeyboardValueChangedHandler)
// A Boolean value that indicates whether the user is pressing any of the keys.
AnyKeyPressed() bool
// Returns the button element for the specified key code.
ButtonForKeyCode(code GCKeyCode) IGCControllerButtonInput
}
An interface definition for the GCKeyboardInput class.
Getting Change Information ¶
- [IGCKeyboardInput.KeyChangedHandler]: The block that the profile calls when the user presses a key.
- [IGCKeyboardInput.SetKeyChangedHandler]
Accessing Buttons ¶
- [IGCKeyboardInput.AnyKeyPressed]: A Boolean value that indicates whether the user is pressing any of the keys.
- [IGCKeyboardInput.ButtonForKeyCode]: Returns the button element for the specified key code.
See: https://developer.apple.com/documentation/GameController/GCKeyboardInput
type IGCMicroGamepad ¶
type IGCMicroGamepad interface {
IGCPhysicalInputProfile
// The controller associated with this profile.
Controller() IGCController
// The block that this profile calls when an element’s value changes.
ValueChangedHandler() GCMicroGamepadValueChangedHandler
SetValueChangedHandler(value GCMicroGamepadValueChangedHandler)
// The menu face button that players use to enter the main menu and pause the game.
ButtonMenu() IGCControllerButtonInput
// The button that the user activates by pressing harder on the touchpad.
ButtonA() IGCControllerButtonInput
// The second face button element.
ButtonX() IGCControllerButtonInput
// The controller’s directional pad element.
Dpad() IGCControllerDirectionPad
// A Boolean value that indicates whether the directional pad reports absolute or relative values.
ReportsAbsoluteDpadValues() bool
SetReportsAbsoluteDpadValues(value bool)
// A Boolean value that indicates whether the profile reports the directional pad values relative to its current orientation.
AllowsRotation() bool
SetAllowsRotation(value bool)
// Copies the input values from a specified micro gamepad to a snapshot of a micro gamepad.
SetStateFromMicroGamepad(microGamepad IGCMicroGamepad)
}
An interface definition for the GCMicroGamepad class.
Getting the controller ¶
- [IGCMicroGamepad.Controller]: The controller associated with this profile.
Receiving a callback when input values change ¶
- [IGCMicroGamepad.ValueChangedHandler]: The block that this profile calls when an element’s value changes.
- [IGCMicroGamepad.SetValueChangedHandler]
Getting face button inputs ¶
- [IGCMicroGamepad.ButtonMenu]: The menu face button that players use to enter the main menu and pause the game.
- [IGCMicroGamepad.ButtonA]: The button that the user activates by pressing harder on the touchpad.
- [IGCMicroGamepad.ButtonX]: The second face button element.
Getting directional pad inputs ¶
- [IGCMicroGamepad.Dpad]: The controller’s directional pad element.
- [IGCMicroGamepad.ReportsAbsoluteDpadValues]: A Boolean value that indicates whether the directional pad reports absolute or relative values.
- [IGCMicroGamepad.SetReportsAbsoluteDpadValues]
- [IGCMicroGamepad.AllowsRotation]: A Boolean value that indicates whether the profile reports the directional pad values relative to its current orientation.
- [IGCMicroGamepad.SetAllowsRotation]
Setting snapshot avlues ¶
- [IGCMicroGamepad.SetStateFromMicroGamepad]: Copies the input values from a specified micro gamepad to a snapshot of a micro gamepad.
See: https://developer.apple.com/documentation/GameController/GCMicroGamepad
type IGCMotion ¶
type IGCMotion interface {
objectivec.IObject
// The controller for the profile.
Controller() IGCController
// The block that the profile calls when an element’s value changes.
ValueChangedHandler() GCMotionValueChangedHandler
SetValueChangedHandler(value GCMotionValueChangedHandler)
// A Boolean value that indicates whether the controller provides attitude data.
HasAttitude() bool
// A Boolean value that indicates whether the controller provides rotation data.
HasRotationRate() bool
// A Boolean value that indicates whether the controller provides gravity and user acceleration data.
HasGravityAndUserAcceleration() bool
// The attitude of the controller.
Attitude() GCQuaternion
// The rotation rate of the controller.
RotationRate() GCRotationRate
// The total acceleration of the controller that includes gravity and the acceleration the user applies to the controller.
Acceleration() GCAcceleration
// The gravity acceleration vector from the controller’s reference frame.
Gravity() GCAcceleration
// The acceleration that the user applies to the controller.
UserAcceleration() GCAcceleration
// A Boolean value that indicates whether the sensors that compute the motion data require manual activation.
SensorsRequireManualActivation() bool
// A Boolean value that indicates whether the sensors that compute the motion data are active.
SensorsActive() bool
SetSensorsActive(value bool)
// Copies the input values from a specified motion profile to a snapshot of a motion profile.
SetStateFromMotion(motion IGCMotion)
// The motion input profile.
Motion() IGCMotion
SetMotion(value IGCMotion)
}
An interface definition for the GCMotion class.
Getting the Controller ¶
- [IGCMotion.Controller]: The controller for the profile.
Receiving a Callback When Input Values Change ¶
- [IGCMotion.ValueChangedHandler]: The block that the profile calls when an element’s value changes.
- [IGCMotion.SetValueChangedHandler]
Verifying Capabilities ¶
- [IGCMotion.HasAttitude]: A Boolean value that indicates whether the controller provides attitude data.
- [IGCMotion.HasRotationRate]: A Boolean value that indicates whether the controller provides rotation data.
- [IGCMotion.HasGravityAndUserAcceleration]: A Boolean value that indicates whether the controller provides gravity and user acceleration data.
Accessing Attitude and Rotation Data ¶
- [IGCMotion.Attitude]: The attitude of the controller.
- [IGCMotion.RotationRate]: The rotation rate of the controller.
Accessing Gravity and Acceleration Data ¶
- [IGCMotion.Acceleration]: The total acceleration of the controller that includes gravity and the acceleration the user applies to the controller.
- [IGCMotion.Gravity]: The gravity acceleration vector from the controller’s reference frame.
- [IGCMotion.UserAcceleration]: The acceleration that the user applies to the controller.
Accessing Sensor Data ¶
- [IGCMotion.SensorsRequireManualActivation]: A Boolean value that indicates whether the sensors that compute the motion data require manual activation.
- [IGCMotion.SensorsActive]: A Boolean value that indicates whether the sensors that compute the motion data are active.
- [IGCMotion.SetSensorsActive]
Setting Snapshot Values ¶
- [IGCMotion.SetStateFromMotion]: Copies the input values from a specified motion profile to a snapshot of a motion profile.
See: https://developer.apple.com/documentation/GameController/GCMotion
type IGCMouse ¶
type IGCMouse interface {
objectivec.IObject
GCDevice
// A notification that posts after a mouse connects to the device.
GCMouseDidConnect() foundation.NSString
// A notification that posts after a mouse disconnects from the device.
GCMouseDidDisconnect() foundation.NSString
// A notification that posts when a mouse becomes the most recent mouse that the user connects.
GCMouseDidBecomeCurrent() foundation.NSString
// A notification that posts when a mouse stops being the most recent mouse that the user connects.
GCMouseDidStopBeingCurrent() foundation.NSString
// The controller profile for the mouse device.
MouseInput() IGCMouseInput
}
An interface definition for the GCMouse class.
Discovering mouse devices ¶
- [IGCMouse.GCMouseDidConnect]: A notification that posts after a mouse connects to the device.
- [IGCMouse.GCMouseDidDisconnect]: A notification that posts after a mouse disconnects from the device.
Handling multiple mouse devices ¶
- [IGCMouse.GCMouseDidBecomeCurrent]: A notification that posts when a mouse becomes the most recent mouse that the user connects.
- [IGCMouse.GCMouseDidStopBeingCurrent]: A notification that posts when a mouse stops being the most recent mouse that the user connects.
Getting input values ¶
- [IGCMouse.MouseInput]: The controller profile for the mouse device.
See: https://developer.apple.com/documentation/GameController/GCMouse
type IGCMouseInput ¶
type IGCMouseInput interface {
IGCPhysicalInputProfile
// The block that the profile calls when the mouse moves.
MouseMovedHandler() GCMouseMoved
SetMouseMovedHandler(value GCMouseMoved)
// The left button on the mouse.
LeftButton() IGCControllerButtonInput
// The optional right button on the mouse.
RightButton() IGCControllerButtonInput
// The optional middle button on the mouse.
MiddleButton() IGCControllerButtonInput
// The optional additional buttons on the mouse.
AuxiliaryButtons() []GCControllerButtonInput
// The location of the directional pad cursor with an undefined range.
Scroll() IGCDeviceCursor
}
An interface definition for the GCMouseInput class.
Getting Change Information ¶
- [IGCMouseInput.MouseMovedHandler]: The block that the profile calls when the mouse moves.
- [IGCMouseInput.SetMouseMovedHandler]
Accessing Buttons ¶
- [IGCMouseInput.LeftButton]: The left button on the mouse.
- [IGCMouseInput.RightButton]: The optional right button on the mouse.
- [IGCMouseInput.MiddleButton]: The optional middle button on the mouse.
- [IGCMouseInput.AuxiliaryButtons]: The optional additional buttons on the mouse.
Scrolling ¶
- [IGCMouseInput.Scroll]: The location of the directional pad cursor with an undefined range.
See: https://developer.apple.com/documentation/GameController/GCMouseInput
type IGCPhysicalInputElementCollection ¶
type IGCPhysicalInputElementCollection interface {
objectivec.IObject
// Returns an enumerator to iterate the elements in the collection.
ElementEnumerator() foundation.NSEnumerator
// The number of elements in the collection.
Count() uint
// Returns the element in the collection for the specified key.
ObjectForKeyedSubscript(key coreservices.Key) objectivec.IObject
// Returns the element in the collection that uses the specified alias.
ElementForAlias(alias coreservices.Key) objectivec.IObject
}
An interface definition for the GCPhysicalInputElementCollection class.
Getting elements in the collection ¶
- [IGCPhysicalInputElementCollection.ElementEnumerator]: Returns an enumerator to iterate the elements in the collection.
- [IGCPhysicalInputElementCollection.Count]: The number of elements in the collection.
Accessing elements by key and alias ¶
- [IGCPhysicalInputElementCollection.ObjectForKeyedSubscript]: Returns the element in the collection for the specified key.
- [IGCPhysicalInputElementCollection.ElementForAlias]: Returns the element in the collection that uses the specified alias.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElementCollection-c.class
type IGCPhysicalInputProfile ¶
type IGCPhysicalInputProfile interface {
objectivec.IObject
// The physical device that the profile represents.
Device() GCDevice
// The time of the most recent change to an element’s value.
LastEventTimestamp() float64
// The block that the profile calls when an element’s value changes.
ValueDidChangeHandler() GCPhysicalInputProfileGCControllerElementHandler
SetValueDidChangeHandler(value GCPhysicalInputProfileGCControllerElementHandler)
// The elements in the profile as key-value pairs for lookup by name.
Elements() foundation.INSDictionary
// The buttons in the profile as key-value pairs for lookup by name.
Buttons() foundation.INSDictionary
// The axes in the profile as key-value pairs for lookup by name.
Axes() foundation.INSDictionary
// The directional pads in the profile as key-value pairs for lookup by name.
Dpads() foundation.INSDictionary
// The touchpads in the profile as key-value pairs for lookup by name.
Touchpads() foundation.INSDictionary
// Returns the element that the key specifies.
ObjectForKeyedSubscript(key string) IGCControllerElement
// The elements in the profile.
AllElements() foundation.INSSet
// The buttons in the profile.
AllButtons() foundation.INSSet
// The axes in the profile.
AllAxes() foundation.INSSet
// The directional pads in the profile.
AllDpads() foundation.INSSet
// The touchpads in the profile.
AllTouchpads() foundation.INSSet
// Returns a snapshot of the profile with its current element values.
Capture() IGCPhysicalInputProfile
// Copies the input values from a specified physical input profile to a snapshot of the profile.
SetStateFromPhysicalInput(physicalInput IGCPhysicalInputProfile)
// A Boolean value that indicates whether the user remaps elements in this profile.
HasRemappedElements() bool
// Returns the name of the input element to which the user remaps the given physical element.
MappedElementAliasForPhysicalInputName(inputName string) string
// Returns the physical input elements to which the user remaps the given input element.
MappedPhysicalInputNamesForElementAlias(elementAlias string) foundation.INSSet
// A notification that posts when the user customizes the button mappings or other settings of a controller.
GCControllerUserCustomizationsDidChange() foundation.NSString
// The extended gamepad profile.
ExtendedGamepad() IGCExtendedGamepad
SetExtendedGamepad(value IGCExtendedGamepad)
// The gamepad profile.
Gamepad() unsafe.Pointer
SetGamepad(value unsafe.Pointer)
// The micro gamepad profile.
MicroGamepad() IGCMicroGamepad
SetMicroGamepad(value IGCMicroGamepad)
// The motion input profile.
Motion() IGCMotion
SetMotion(value IGCMotion)
// The physical input profile for the controller.
PhysicalInputProfile() IGCPhysicalInputProfile
SetPhysicalInputProfile(value IGCPhysicalInputProfile)
}
An interface definition for the GCPhysicalInputProfile class.
Getting the device ¶
- [IGCPhysicalInputProfile.Device]: The physical device that the profile represents.
Getting change information ¶
- [IGCPhysicalInputProfile.LastEventTimestamp]: The time of the most recent change to an element’s value.
- [IGCPhysicalInputProfile.ValueDidChangeHandler]: The block that the profile calls when an element’s value changes.
- [IGCPhysicalInputProfile.SetValueDidChangeHandler]
Accessing elements by name or key ¶
- [IGCPhysicalInputProfile.Elements]: The elements in the profile as key-value pairs for lookup by name.
- [IGCPhysicalInputProfile.Buttons]: The buttons in the profile as key-value pairs for lookup by name.
- [IGCPhysicalInputProfile.Axes]: The axes in the profile as key-value pairs for lookup by name.
- [IGCPhysicalInputProfile.Dpads]: The directional pads in the profile as key-value pairs for lookup by name.
- [IGCPhysicalInputProfile.Touchpads]: The touchpads in the profile as key-value pairs for lookup by name.
- [IGCPhysicalInputProfile.ObjectForKeyedSubscript]: Returns the element that the key specifies.
Getting elements by type ¶
- [IGCPhysicalInputProfile.AllElements]: The elements in the profile.
- [IGCPhysicalInputProfile.AllButtons]: The buttons in the profile.
- [IGCPhysicalInputProfile.AllAxes]: The axes in the profile.
- [IGCPhysicalInputProfile.AllDpads]: The directional pads in the profile.
- [IGCPhysicalInputProfile.AllTouchpads]: The touchpads in the profile.
Setting snapshot values ¶
- [IGCPhysicalInputProfile.Capture]: Returns a snapshot of the profile with its current element values.
- [IGCPhysicalInputProfile.SetStateFromPhysicalInput]: Copies the input values from a specified physical input profile to a snapshot of the profile.
Remapping input elements ¶
- [IGCPhysicalInputProfile.HasRemappedElements]: A Boolean value that indicates whether the user remaps elements in this profile.
- [IGCPhysicalInputProfile.MappedElementAliasForPhysicalInputName]: Returns the name of the input element to which the user remaps the given physical element.
- [IGCPhysicalInputProfile.MappedPhysicalInputNamesForElementAlias]: Returns the physical input elements to which the user remaps the given input element.
- [IGCPhysicalInputProfile.GCControllerUserCustomizationsDidChange]: A notification that posts when the user customizes the button mappings or other settings of a controller.
See: https://developer.apple.com/documentation/GameController/GCPhysicalInputProfile
type IGCRacingWheel ¶
type IGCRacingWheel interface {
objectivec.IObject
GCDevice
// A notification that posts after a racing wheel controller connects to the device.
GCRacingWheelDidConnect() foundation.NSString
// A notification that posts after a racing wheel controller disconnects from the device.
GCRacingWheelDidDisconnect() foundation.NSString
// Starts receiving events from the racing wheel.
AcquireDeviceWithError() (bool, error)
// Stops receiving events from the racing wheel.
RelinquishDevice()
// A Boolean value that indicates whether the racing wheel sends events to the app.
Acquired() bool
// The physical input profile for the racing wheel.
WheelInput() IGCRacingWheelInput
// Returns a snapshot of the racing wheel with its current element values.
Capture() IGCRacingWheel
// A Boolean value that indicates whether the object is a snapshot of a racing wheel.
Snapshot() bool
}
An interface definition for the GCRacingWheel class.
Discovering racing wheels ¶
- [IGCRacingWheel.GCRacingWheelDidConnect]: A notification that posts after a racing wheel controller connects to the device.
- [IGCRacingWheel.GCRacingWheelDidDisconnect]: A notification that posts after a racing wheel controller disconnects from the device.
Getting events ¶
- [IGCRacingWheel.AcquireDeviceWithError]: Starts receiving events from the racing wheel.
- [IGCRacingWheel.RelinquishDevice]: Stops receiving events from the racing wheel.
- [IGCRacingWheel.Acquired]: A Boolean value that indicates whether the racing wheel sends events to the app.
Accessing the controller profile ¶
- [IGCRacingWheel.WheelInput]: The physical input profile for the racing wheel.
Creating snapshots ¶
- [IGCRacingWheel.Capture]: Returns a snapshot of the racing wheel with its current element values.
- [IGCRacingWheel.Snapshot]: A Boolean value that indicates whether the object is a snapshot of a racing wheel.
See: https://developer.apple.com/documentation/GameController/GCRacingWheel
type IGCRacingWheelInput ¶
type IGCRacingWheelInput interface {
IGCRacingWheelInputState
// Returns a snapshot of the racing wheel inputs.
Capture() IGCRacingWheelInputState
// Returns the next input state of the racing wheel from the queue.
NextInputState() IGCRacingWheelInputState
}
An interface definition for the GCRacingWheelInput class.
Creating snapshots ¶
- [IGCRacingWheelInput.Capture]: Returns a snapshot of the racing wheel inputs.
Polling for input ¶
- [IGCRacingWheelInput.NextInputState]: Returns the next input state of the racing wheel from the queue.
See: https://developer.apple.com/documentation/GameController/GCRacingWheelInput
type IGCRacingWheelInputState ¶
type IGCRacingWheelInputState interface {
objectivec.IObject
GCDevicePhysicalInputState
// The controller’s wheel element.
Wheel() IGCSteeringWheelElement
// The controller’s accelerator pedal element.
AcceleratorPedal() GCButtonElement
// The controller’s brake pedal element.
BrakePedal() GCButtonElement
// The controller’s clutch element.
ClutchPedal() GCButtonElement
// The controller’s gear shift element.
Shifter() IGCGearShifterElement
// The name of the steering wheel element.
GCInputSteeringWheel() string
SetGCInputSteeringWheel(value string)
// The name of the shifter element.
GCInputShifter() string
SetGCInputShifter(value string)
// The name of the clutch element.
GCInputPedalClutch() string
SetGCInputPedalClutch(value string)
// The name of the accelerator element.
GCInputPedalAccelerator() string
SetGCInputPedalAccelerator(value string)
// The name of the brake element.
GCInputPedalBrake() string
SetGCInputPedalBrake(value string)
}
An interface definition for the GCRacingWheelInputState class.
Getting input elements ¶
- [IGCRacingWheelInputState.Wheel]: The controller’s wheel element.
- [IGCRacingWheelInputState.AcceleratorPedal]: The controller’s accelerator pedal element.
- [IGCRacingWheelInputState.BrakePedal]: The controller’s brake pedal element.
- [IGCRacingWheelInputState.ClutchPedal]: The controller’s clutch element.
- [IGCRacingWheelInputState.Shifter]: The controller’s gear shift element.
Accessing elements by name ¶
- [IGCRacingWheelInputState.GCInputSteeringWheel]: The name of the steering wheel element.
- [IGCRacingWheelInputState.SetGCInputSteeringWheel]
- [IGCRacingWheelInputState.GCInputShifter]: The name of the shifter element.
- [IGCRacingWheelInputState.SetGCInputShifter]
- [IGCRacingWheelInputState.GCInputPedalClutch]: The name of the clutch element.
- [IGCRacingWheelInputState.SetGCInputPedalClutch]
- [IGCRacingWheelInputState.GCInputPedalAccelerator]: The name of the accelerator element.
- [IGCRacingWheelInputState.SetGCInputPedalAccelerator]
- [IGCRacingWheelInputState.GCInputPedalBrake]: The name of the brake element.
- [IGCRacingWheelInputState.SetGCInputPedalBrake]
See: https://developer.apple.com/documentation/GameController/GCRacingWheelInputState
type IGCSteeringWheelElement ¶
type IGCSteeringWheelElement interface {
objectivec.IObject
GCAxisElement
GCPhysicalInputElement
// The maximum number of degrees that the user can rotate the wheel.
MaximumDegreesOfRotation() float32
}
An interface definition for the GCSteeringWheelElement class.
Getting the characteristics ¶
- [IGCSteeringWheelElement.MaximumDegreesOfRotation]: The maximum number of degrees that the user can rotate the wheel.
See: https://developer.apple.com/documentation/GameController/GCSteeringWheelElement
type IGCXboxGamepad ¶
type IGCXboxGamepad interface {
IGCExtendedGamepad
// The controller’s paddle 1 button element, which has a P1 label on the back of the controller.
PaddleButton1() IGCControllerButtonInput
// The paddle 2 button element, which has a P2 label on the back of the controller.
PaddleButton2() IGCControllerButtonInput
// The paddle 3 button element, which has a P3 label on the back of the controller.
PaddleButton3() IGCControllerButtonInput
// The paddle 4 button element, which has a P4 label on the back of the controller.
PaddleButton4() IGCControllerButtonInput
ButtonShare() IGCControllerButtonInput
}
An interface definition for the GCXboxGamepad class.
Getting button inputs ¶
- [IGCXboxGamepad.PaddleButton1]: The controller’s paddle 1 button element, which has a P1 label on the back of the controller.
- [IGCXboxGamepad.PaddleButton2]: The paddle 2 button element, which has a P2 label on the back of the controller.
- [IGCXboxGamepad.PaddleButton3]: The paddle 3 button element, which has a P3 label on the back of the controller.
- [IGCXboxGamepad.PaddleButton4]: The paddle 4 button element, which has a P4 label on the back of the controller.
- [IGCXboxGamepad.ButtonShare]: The share button on an Xbox Series X|S controller or later.
See: https://developer.apple.com/documentation/GameController/GCXboxGamepad
type VoidHandler ¶
type VoidHandler = func()
VoidHandler handles The block that the framework calls when it completes the request.
Used by:
- [GCController.StartWirelessControllerDiscoveryWithCompletionHandler]
Source Files
¶
- blocks.gen.go
- doc.gen.go
- enums.gen.go
- functions.gen.go
- gc_axis2_d_input_protocol.gen.go
- gc_axis_element_name_protocol.gen.go
- gc_axis_element_protocol.gen.go
- gc_axis_input_protocol.gen.go
- gc_button_element_name_protocol.gen.go
- gc_button_element_protocol.gen.go
- gc_color.gen.go
- gc_controller.gen.go
- gc_controller_axis_input.gen.go
- gc_controller_button_input.gen.go
- gc_controller_direction_pad.gen.go
- gc_controller_element.gen.go
- gc_controller_input_state.gen.go
- gc_controller_live_input.gen.go
- gc_controller_touchpad.gen.go
- gc_device_battery.gen.go
- gc_device_cursor.gen.go
- gc_device_haptics.gen.go
- gc_device_light.gen.go
- gc_device_physical_input_protocol.gen.go
- gc_device_physical_input_state_diff_protocol.gen.go
- gc_device_physical_input_state_protocol.gen.go
- gc_device_protocol.gen.go
- gc_direction_pad_element_name_protocol.gen.go
- gc_direction_pad_element_protocol.gen.go
- gc_directional_gamepad.gen.go
- gc_dual_sense_adaptive_trigger.gen.go
- gc_dual_sense_gamepad.gen.go
- gc_dual_shock_gamepad.gen.go
- gc_event_view_controller.gen.go
- gc_extended_gamepad.gen.go
- gc_gear_shifter_element.gen.go
- gc_keyboard.gen.go
- gc_keyboard_input.gen.go
- gc_linear_input_protocol.gen.go
- gc_micro_gamepad.gen.go
- gc_motion.gen.go
- gc_mouse.gen.go
- gc_mouse_input.gen.go
- gc_physical_input_element_collection.gen.go
- gc_physical_input_element_name_protocol.gen.go
- gc_physical_input_element_protocol.gen.go
- gc_physical_input_extents_protocol.gen.go
- gc_physical_input_profile.gen.go
- gc_physical_input_source_protocol.gen.go
- gc_pressed_state_input_protocol.gen.go
- gc_racing_wheel.gen.go
- gc_racing_wheel_input.gen.go
- gc_racing_wheel_input_state.gen.go
- gc_relative_input_protocol.gen.go
- gc_steering_wheel_element.gen.go
- gc_switch_element_name_protocol.gen.go
- gc_switch_element_protocol.gen.go
- gc_switch_position_input_protocol.gen.go
- gc_touched_state_input_protocol.gen.go
- gc_xbox_gamepad.gen.go
- generate.go
- global_vars.gen.go
- typedefs.gen.go
- types.gen.go
- undefined_types.gen.go