gamecontroller

package
v0.6.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2026 License: MIT Imports: 15 Imported by: 0

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

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

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.
  • GCControllerLiveInput - The input profile for a controller.
  • GCExtendedGamepad - A controller profile that supports the extended set of gamepad controls.
  • GCRacingWheelInput - A controller profile that supports a racing wheel.
  • GCRacingWheelInputState - The input for the wheel of a racing wheel controller.
  • GCMotion - A controller profile that supports orientation and motion.
  • 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

Constants

This section is empty.

Variables

View Source
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
)
View Source
var (
	// GCHapticDurationInfinite is an infinite duration for a haptics event.
	//
	// See: https://developer.apple.com/documentation/GameController/GCHapticDurationInfinite
	GCHapticDurationInfinite float32
)
View Source
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.

View Source
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 input provides analog values.
	//
	// See: https://developer.apple.com/documentation/GameController/GCAxis2DInput/isAnalog
	IsAnalog() 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
	CanWrap() bool

	// A Boolean value that indicates whether the input provides analog values.
	//
	// See: https://developer.apple.com/documentation/GameController/GCAxis2DInput/isAnalog
	Analog() 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 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) Analog added in v0.6.4

func (o GCAxis2DInputObject) Analog() bool

A Boolean value that indicates whether the input provides analog values.

Discussion

This property is true for most axis inputs.

See: https://developer.apple.com/documentation/GameController/GCAxis2DInput/isAnalog

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.

Discussion

This property is false for most axis inputs.

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.

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.

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.

Discussion

This property isn’t a specific date and time. To determine the time between value changes in seconds, subtract a previous time from the current time.

See: https://developer.apple.com/documentation/GameController/GCAxis2DInput/lastValueTimestamp

func (GCAxis2DInputObject) Sources

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.

Discussion

The values of the coordinates range between `-1` and `1` where `(0,0)` is the fixed origin. Game Controller deadzones and saturates the values so there’s no value outside this range. A zero coordinate is inside the deadzone and any coordinate greater than or less than zero is outside the deadzone.

See: https://developer.apple.com/documentation/GameController/GCAxis2DInput/value

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

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 input provides analog values.
	//
	// See: https://developer.apple.com/documentation/GameController/GCAxisInput/isAnalog
	IsAnalog() 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
	CanWrap() bool

	// A Boolean value that indicates whether the input provides analog values.
	//
	// See: https://developer.apple.com/documentation/GameController/GCAxisInput/isAnalog
	Analog() bool

	// The value along the axis, in unit coordinates.
	//
	// See: https://developer.apple.com/documentation/GameController/GCAxisInput/value
	Value() 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) Analog added in v0.6.4

func (o GCAxisInputObject) Analog() bool

A Boolean value that indicates whether the input provides analog values.

See: https://developer.apple.com/documentation/GameController/GCAxisInput/isAnalog

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.

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.

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.

Discussion

This property isn’t a specific date and time. To determine the time between value changes, subtract a previous time from the current time.

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

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 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

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

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.

Discussion

Some buttons feature load cells (also known as button force transducers) capable of measuring applied mechanical force.

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

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

func GCColorFromID(id objc.ID) GCColor

GCColorFromID constructs a GCColor from an objc.ID.

The color of a device light.

func NewGCColor

func NewGCColor() GCColor

NewGCColor creates a new GCColor instance.

func NewGCColorWithRedGreenBlue

func NewGCColorWithRedGreenBlue(red float32, green float32, blue float32) GCColor

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

func (g GCColor) Autorelease() GCColor

Autorelease adds the receiver to the current autorelease pool.

func (GCColor) Blue

func (g GCColor) Blue() float32

The normalized value of the blue component ranging from 0 to 1.

See: https://developer.apple.com/documentation/GameController/GCColor/blue

func (GCColor) Color

func (g GCColor) Color() IGCColor

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

func (g GCColor) Green() float32

The normalized value of the green component ranging from 0 to 1.

See: https://developer.apple.com/documentation/GameController/GCColor/green

func (GCColor) Init

func (g GCColor) Init() GCColor

Init initializes the instance.

func (GCColor) InitWithRedGreenBlue

func (g GCColor) InitWithRedGreenBlue(red float32, green float32, blue float32) GCColor

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

func (g GCColor) Red() float32

The normalized value of the red component ranging from 0 to 1.

See: https://developer.apple.com/documentation/GameController/GCColor/red

func (GCColor) SetColor

func (g GCColor) SetColor(value IGCColor)

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

Handling multiple controllers

Inspecting a controller

Accessing controller input

Accessing controller profiles

Identifying controllers and displaying a player index

Accessing battery, haptics, and light objects

Creating snapshots

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) 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.

See: https://developer.apple.com/documentation/Foundation/NSNotification/Name-swift.struct/GCControllerDidBecomeCurrent

func (GCController) GCControllerDidConnect

func (g GCController) GCControllerDidConnect() foundation.NSString

A notification that posts after a controller connects to the device.

See: https://developer.apple.com/documentation/Foundation/NSNotification/Name-swift.struct/GCControllerDidConnect

func (GCController) GCControllerDidDisconnect

func (g GCController) GCControllerDidDisconnect() foundation.NSString

A notification that posts after a controller disconnects from the device.

See: https://developer.apple.com/documentation/Foundation/NSNotification/Name-swift.struct/GCControllerDidDisconnect

func (GCController) GCControllerDidStopBeingCurrent

func (g GCController) GCControllerDidStopBeingCurrent() foundation.NSString

A notification that posts when a controller stops being the current controller.

See: https://developer.apple.com/documentation/Foundation/NSNotification/Name-swift.struct/GCControllerDidStopBeingCurrent

func (GCController) HandlerQueue

func (g GCController) 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 (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) Init

func (g GCController) Init() GCController

Init initializes the instance.

func (GCController) Input

The input profile for the controller.

See: https://developer.apple.com/documentation/GameController/GCController/input

func (GCController) IsAttachedToDevice added in v0.6.5

func (g GCController) IsAttachedToDevice() 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) IsSnapshot added in v0.6.5

func (g GCController) IsSnapshot() 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) 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 GCControllerPlayerIndexUnset.

The default value for this property is GCControllerPlayerIndexUnset.

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 (o GCController) 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 (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) 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.

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

Getting change information

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

Autorelease adds the receiver to the current autorelease pool.

func (GCControllerAxisInput) Init

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

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

Alloc allocates memory for a new instance of the class.

func (GCControllerAxisInputClass) 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

Getting change information

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

Autorelease adds the receiver to the current autorelease pool.

func (GCControllerButtonInput) Init

Init initializes the instance.

func (GCControllerButtonInput) IsPressed added in v0.6.5

func (g GCControllerButtonInput) IsPressed() 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) IsTouched added in v0.6.5

func (g GCControllerButtonInput) IsTouched() 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) PressedChangedHandler

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.

See: https://developer.apple.com/documentation/GameController/GCControllerButtonInput/pressedChangedHandler

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) TouchedChangedHandler

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.

See: https://developer.apple.com/documentation/GameController/GCControllerButtonInput/touchedChangedHandler

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

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

Alloc allocates memory for a new instance of the class.

func (GCControllerButtonInputClass) 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.

See: https://developer.apple.com/documentation/GameController/GCController/startWirelessControllerDiscovery(completionHandler:)

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.

See: https://developer.apple.com/documentation/GameController/GCController/stopWirelessControllerDiscovery()

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

Accessing values using directional buttons

Getting change information

Setting snapshot values

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

Autorelease adds the receiver to the current autorelease pool.

func (GCControllerDirectionPad) Down

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

Init initializes the instance.

func (GCControllerDirectionPad) Left

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

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 (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.

See: https://developer.apple.com/documentation/GameController/GCControllerDirectionPad/setValueForXAxis(_:yAxis:)

func (GCControllerDirectionPad) Up

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

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.

See: https://developer.apple.com/documentation/GameController/GCControllerDirectionPad/valueChangedHandler

func (GCControllerDirectionPad) XAxis

The x-axis element of the directional pad.

See: https://developer.apple.com/documentation/GameController/GCControllerDirectionPad/xAxis

func (GCControllerDirectionPad) YAxis

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

Alloc allocates memory for a new instance of the class.

func (GCControllerDirectionPadClass) 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 GCSystemGestureStateAlwaysReceive to receive the input simultaneously without delay. Alternatively, set it to GCSystemGestureStateDisabled 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

Getting a localized name

Displaying a symbol

Accessing elements by key

Getting the containing element

Handling system gesture input

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

The element’s aliases you use when accessing it with the subscript notation.

See: https://developer.apple.com/documentation/GameController/GCControllerElement/aliases

func (GCControllerElement) Autorelease

func (g GCControllerElement) Autorelease() GCControllerElement

Autorelease adds the receiver to the current autorelease pool.

func (GCControllerElement) Collection

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

Init initializes the instance.

func (GCControllerElement) IsAnalog added in v0.6.5

func (g GCControllerElement) IsAnalog() 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) IsBoundToSystemGesture added in v0.6.5

func (g GCControllerElement) IsBoundToSystemGesture() 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) 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 GCSystemGestureStateEnabled.

See: https://developer.apple.com/documentation/GameController/GCControllerElement/preferredSystemGestureState

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

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

Autorelease adds the receiver to the current autorelease pool.

func (GCControllerInputState) Axes added in v0.6.4

The device’s axes as key-value pairs for lookup by name.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/axes-80rx

func (GCControllerInputState) Buttons added in v0.6.4

The device’s buttons as key-value pairs for lookup by name.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/buttons-3257g

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) Dpads added in v0.6.4

The device’s directional pads as key-value pairs for lookup by name.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/dpads-5yr9x

func (GCControllerInputState) Elements added in v0.6.4

The device’s elements as key-value pairs for lookup by name.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/elements-1shp2

func (GCControllerInputState) Init

Init initializes the instance.

func (GCControllerInputState) Input

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.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/lastEventLatency

func (GCControllerInputState) LastEventTimestamp

func (g GCControllerInputState) LastEventTimestamp() float64

The time of the most recent event.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/lastEventTimestamp

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 (GCControllerInputState) Switches added in v0.6.4

The device’s switches as key-value pairs for lookup by name.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/switches-6bws2

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

Alloc allocates memory for a new instance of the class.

func (GCControllerInputStateClass) 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

Remapping 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

Autorelease adds the receiver to the current autorelease pool.

func (GCControllerLiveInput) Capture

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() func(objc.ID)

A block that the profile calls when an element’s value changes.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInput/elementValueDidChangeHandler

func (GCControllerLiveInput) Init

Init initializes the instance.

func (GCControllerLiveInput) InputStateAvailableHandler

func (g GCControllerLiveInput) InputStateAvailableHandler() func(objc.ID)

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

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

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

The dispatch queue that the system uses for callbacks.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInput/queue

func (GCControllerLiveInput) SetInputStateQueueDepth

func (g GCControllerLiveInput) SetInputStateQueueDepth(value int)

func (GCControllerLiveInput) UnmappedInput

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

Alloc allocates memory for a new instance of the class.

func (GCControllerLiveInputClass) 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

Accessing the input values

Getting change information

Setting snapshot values

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

Autorelease adds the receiver to the current autorelease pool.

func (GCControllerTouchpad) Button

The element that represents the button component on the touchpad.

See: https://developer.apple.com/documentation/GameController/GCControllerTouchpad/button

func (GCControllerTouchpad) Init

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.

See: https://developer.apple.com/documentation/GameController/GCControllerTouchpad/reportsAbsoluteTouchSurfaceValues

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 (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`)`.

See: https://developer.apple.com/documentation/GameController/GCControllerTouchpad/setValueForXAxis(_:yAxis:touchDown:buttonValue:)

func (GCControllerTouchpad) TouchDown

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

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.

See: https://developer.apple.com/documentation/GameController/GCControllerTouchpad/touchState-swift.property

func (GCControllerTouchpad) TouchSurface

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

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

Alloc allocates memory for a new instance of the class.

func (GCControllerTouchpadClass) 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 device’s physical input profile, such as a controller’s extended gamepad.
	//
	// See: https://developer.apple.com/documentation/GameController/GCDevice/physicalInputProfile
	PhysicalInputProfile() IGCPhysicalInputProfile

	// 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
	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

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

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

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

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

Getting the localities

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) objectivec.IObject

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

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

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

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.

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) 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)

func (GCDeviceObject) VendorName

func (o GCDeviceObject) 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 GCDevicePhysicalInput

type GCDevicePhysicalInput interface {
	objectivec.IObject
	GCDevicePhysicalInputState

	// Returns the next input state from the queue.
	//
	// See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInput/nextInputState()
	NextInputState() objectivec.IObject

	// Returns a snapshot of the physical device inputs.
	//
	// See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInput/capture()
	Capture() GCDevicePhysicalInputState

	// The device that the physical input represents.
	//
	// See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInput/device
	Device() GCDevice

	// The maximum number of input values that the queue stores.
	//
	// See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInput/inputStateQueueDepth
	InputStateQueueDepth() int
	SetInputStateQueueDepth(value int)

	// The dispatch queue that the system uses for callbacks.
	//
	// See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInput/queue
	Queue() dispatch.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

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) Axes added in v0.6.4

The device’s axes as key-value pairs for lookup by name.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/axes-80rx

func (GCDevicePhysicalInputObject) BaseObject

func (GCDevicePhysicalInputObject) Buttons added in v0.6.4

The device’s buttons as key-value pairs for lookup by name.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/buttons-3257g

func (GCDevicePhysicalInputObject) Capture

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

The device that the physical input represents.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInput/device

func (GCDevicePhysicalInputObject) Dpads added in v0.6.4

The device’s directional pads as key-value pairs for lookup by name.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/dpads-5yr9x

func (GCDevicePhysicalInputObject) Elements added in v0.6.4

The device’s elements as key-value pairs for lookup by name.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/elements-1shp2

func (GCDevicePhysicalInputObject) InputStateQueueDepth

func (o GCDevicePhysicalInputObject) 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 (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.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/lastEventTimestamp

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

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 (GCDevicePhysicalInputObject) SetInputStateQueueDepth

func (o GCDevicePhysicalInputObject) SetInputStateQueueDepth(value int)

func (GCDevicePhysicalInputObject) SetQueue

func (o GCDevicePhysicalInputObject) SetQueue(value dispatch.Queue)

func (GCDevicePhysicalInputObject) Switches added in v0.6.4

The device’s switches as key-value pairs for lookup by name.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/switches-6bws2

type GCDevicePhysicalInputState

type GCDevicePhysicalInputState interface {
	objectivec.IObject

	// Returns the element that the key specifies.
	//
	// See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/subscript(_:)
	ObjectForKeyedSubscript(key string) GCPhysicalInputElement

	// 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

	// The device’s elements as key-value pairs for lookup by name.
	//
	// See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/elements-1shp2
	Elements() IGCPhysicalInputElementCollection

	// The device’s axes as key-value pairs for lookup by name.
	//
	// See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/axes-80rx
	Axes() IGCPhysicalInputElementCollection

	// The device’s buttons as key-value pairs for lookup by name.
	//
	// See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/buttons-3257g
	Buttons() IGCPhysicalInputElementCollection

	// The device’s directional pads as key-value pairs for lookup by name.
	//
	// See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/dpads-5yr9x
	Dpads() IGCPhysicalInputElementCollection

	// The device’s switches as key-value pairs for lookup by name.
	//
	// See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/switches-6bws2
	Switches() IGCPhysicalInputElementCollection
}

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

	// Returns the elements that changed since the previous input state.
	//
	// See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputStateDiff/changedElements
	ChangedElements() foundation.NSEnumerator
}

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 (GCDevicePhysicalInputStateDiffObject) ChangeForElement

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:)

func (GCDevicePhysicalInputStateDiffObject) ChangedElements added in v0.6.4

Returns the elements that changed since the previous input state.

Return Value

An enumerator that contains the changed elements in no particular order.

Discussion

Returns `nil` if there’s no previous input state, either because this is the first input state or Game Controller discards the prior input state because the queue is full.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputStateDiff/changedElements

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) Axes added in v0.6.4

The device’s axes as key-value pairs for lookup by name.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/axes-80rx

func (GCDevicePhysicalInputStateObject) BaseObject

func (GCDevicePhysicalInputStateObject) Buttons added in v0.6.4

The device’s buttons as key-value pairs for lookup by name.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/buttons-3257g

func (GCDevicePhysicalInputStateObject) Device

The physical device that this profile represents.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/device

func (GCDevicePhysicalInputStateObject) Dpads added in v0.6.4

The device’s directional pads as key-value pairs for lookup by name.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/dpads-5yr9x

func (GCDevicePhysicalInputStateObject) Elements added in v0.6.4

The device’s elements as key-value pairs for lookup by name.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/elements-1shp2

func (GCDevicePhysicalInputStateObject) LastEventLatency

func (o GCDevicePhysicalInputStateObject) 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 (GCDevicePhysicalInputStateObject) LastEventTimestamp

func (o GCDevicePhysicalInputStateObject) 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.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/lastEventTimestamp

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(_:)

func (GCDevicePhysicalInputStateObject) Switches added in v0.6.4

The device’s switches as key-value pairs for lookup by name.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/switches-6bws2

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 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

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

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 (GCDirectionPadElementObject) Down

The input object that represents the down button on the directional pad.

See: https://developer.apple.com/documentation/GameController/GCDirectionPadElement/down

func (GCDirectionPadElementObject) Left

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

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

The input object that represents the up button on the directional pad.

See: https://developer.apple.com/documentation/GameController/GCDirectionPadElement/up

func (GCDirectionPadElementObject) XAxis

The input object that represents the x-axis on the directional pad.

See: https://developer.apple.com/documentation/GameController/GCDirectionPadElement/xAxis

func (GCDirectionPadElementObject) XyAxes

The location of the directional pad represented as a point.

See: https://developer.apple.com/documentation/GameController/GCDirectionPadElement/xyAxes

func (GCDirectionPadElementObject) YAxis

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

Autorelease adds the receiver to the current autorelease pool.

func (GCDirectionalGamepad) Init

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) SetAnalog added in v0.6.4

func (g GCDirectionalGamepad) SetAnalog(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

Alloc allocates memory for a new instance of the class.

func (GCDirectionalGamepadClass) 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

Configuring the trigger

Getting the arm position

Checking the status

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

Autorelease adds the receiver to the current autorelease pool.

func (GCDualSenseAdaptiveTrigger) Init

Init initializes the instance.

func (GCDualSenseAdaptiveTrigger) Mode

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.

See: https://developer.apple.com/documentation/GameController/GCDualSenseAdaptiveTrigger/mode-swift.property

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.

See: https://developer.apple.com/documentation/GameController/GCDualSenseAdaptiveTrigger/setModeFeedback(resistiveStrengths:)

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.

See: https://developer.apple.com/documentation/GameController/GCDualSenseAdaptiveTrigger/setModeFeedbackWithStartPosition(_:resistiveStrength:)

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.

See: https://developer.apple.com/documentation/GameController/GCDualSenseAdaptiveTrigger/setModeSlopeFeedback(startPosition:endPosition:startStrength:endStrength:)

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.

See: https://developer.apple.com/documentation/GameController/GCDualSenseAdaptiveTrigger/setModeVibration(amplitudes: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.

See: https://developer.apple.com/documentation/GameController/GCDualSenseAdaptiveTrigger/setModeVibrationWithStartPosition(_:amplitude: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.

See: https://developer.apple.com/documentation/GameController/GCDualSenseAdaptiveTrigger/setModeWeaponWithStartPosition(_:endPosition:resistiveStrength:)

func (GCDualSenseAdaptiveTrigger) Status

The current status of the adaptive trigger and whether it’s applying effects.

See: https://developer.apple.com/documentation/GameController/GCDualSenseAdaptiveTrigger/status-swift.property

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

Alloc allocates memory for a new instance of the class.

func (GCDualSenseAdaptiveTriggerClass) Class

Class returns the underlying Objective-C class pointer.

type GCDualSenseAdaptiveTriggerDiscretePosition added in v0.6.4

type GCDualSenseAdaptiveTriggerDiscretePosition uint
const (
	// GCDualSenseAdaptiveTriggerDiscretePositionCount: The number of discrete control positions that the DualSense adaptive triggers support.
	GCDualSenseAdaptiveTriggerDiscretePositionCount GCDualSenseAdaptiveTriggerDiscretePosition = 10
)

func (GCDualSenseAdaptiveTriggerDiscretePosition) String added in v0.6.4

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

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

See: https://developer.apple.com/documentation/GameController/GCDualSenseAdaptiveTrigger/Status-swift.enum

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

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

Tracking finger locations

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

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

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

Tracking finger locations

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

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

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

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

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.

See: https://developer.apple.com/documentation/GameController/GCEventViewController/controllerUserInteractionEnabled

func (GCEventViewController) Init

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

Alloc allocates memory for a new instance of the class.

func (GCEventViewControllerClass) 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

Getting change information

Getting shoulder button inputs

Getting trigger inputs

Getting face button inputs

Getting directional pad inputs

Getting thumbstick and thumbstick button inputs

Setting snapshot values

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

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

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

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

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

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

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

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

Init initializes the instance.

func (GCExtendedGamepad) LeftShoulder

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

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

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

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

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 (
	// Deprecated.
	GCExtendedGamepadSnapshotDataVersion1 GCExtendedGamepadSnapshotDataVersion = 0x100
	// Deprecated.
	GCExtendedGamepadSnapshotDataVersion2 GCExtendedGamepadSnapshotDataVersion = 0x101
)

func (GCExtendedGamepadSnapshotDataVersion) 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

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

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

Autorelease adds the receiver to the current autorelease pool.

func (GCGearShifterElement) Init

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

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

Alloc allocates memory for a new instance of the class.

func (GCGearShifterElementClass) 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
	// GCInputButtonShare is the name of the share button.
	//
	// 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
	// See: https://developer.apple.com/documentation/GameController/GCInputLeftSideButton
	GCInputLeftSideButton 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
	// See: https://developer.apple.com/documentation/GameController/GCInputRightSideButton
	GCInputRightSideButton 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

Getting input values

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.

See: https://developer.apple.com/documentation/Foundation/NSNotification/Name-swift.struct/GCKeyboardDidConnect

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.

See: https://developer.apple.com/documentation/Foundation/NSNotification/Name-swift.struct/GCKeyboardDidDisconnect

func (GCKeyboard) HandlerQueue

func (g GCKeyboard) 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 (GCKeyboard) Init

func (g GCKeyboard) Init() GCKeyboard

Init initializes the instance.

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 (o GCKeyboard) 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 (GCKeyboard) VendorName

func (g GCKeyboard) 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 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

Accessing Buttons

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) 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

Init initializes the instance.

func (GCKeyboardInput) IsAnyKeyPressed added in v0.6.5

func (g GCKeyboardInput) IsAnyKeyPressed() 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) 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

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 provides analog values.
	//
	// See: https://developer.apple.com/documentation/GameController/GCLinearInput/isAnalog
	IsAnalog() 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
	CanWrap() bool

	// A Boolean value that indicates whether the input provides analog values.
	//
	// See: https://developer.apple.com/documentation/GameController/GCLinearInput/isAnalog
	Analog() bool

	// The value in unit coordinates.
	//
	// See: https://developer.apple.com/documentation/GameController/GCLinearInput/value
	Value() 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) Analog added in v0.6.4

func (o GCLinearInputObject) Analog() bool

A Boolean value that indicates whether the input provides analog values.

See: https://developer.apple.com/documentation/GameController/GCLinearInput/isAnalog

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.

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.

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.

Discussion

This property isn’t a specific date and time. To determine the time between value changes, subtract a previous time from the current time.

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

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

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

Receiving a callback when input values change

Getting face button inputs

Getting directional pad inputs

Setting snapshot avlues

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

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

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

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

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

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 (
	// Deprecated.
	GCMicroGamepadSnapshotDataVersion1 GCMicroGamepadSnapshotDataVersion = 0x100
)

func (GCMicroGamepadSnapshotDataVersion) 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

Receiving a Callback When Input Values Change

Verifying Capabilities

Accessing Attitude and Rotation Data

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

Setting Snapshot Values

See: https://developer.apple.com/documentation/GameController/GCMotion

func GCMotionFromID

func GCMotionFromID(id objc.ID) GCMotion

GCMotionFromID constructs a GCMotion from an objc.ID.

A controller profile that supports orientation and motion.

func NewGCMotion

func NewGCMotion() GCMotion

NewGCMotion creates a new GCMotion instance.

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

func (g GCMotion) Autorelease() GCMotion

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

func (g GCMotion) HasAttitude() bool

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

func (g GCMotion) HasGravityAndUserAcceleration() bool

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

func (g GCMotion) HasRotationRate() bool

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) Init

func (g GCMotion) Init() GCMotion

Init initializes the instance.

func (GCMotion) Motion

func (g GCMotion) Motion() IGCMotion

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

func (g GCMotion) SensorsActive() bool

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

func (g GCMotion) SensorsRequireManualActivation() bool

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) SetMotion

func (g GCMotion) SetMotion(value IGCMotion)

func (GCMotion) SetSensorsActive

func (g GCMotion) SetSensorsActive(value bool)

func (GCMotion) SetStateFromMotion

func (g GCMotion) SetStateFromMotion(motion IGCMotion)

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

Handling multiple mouse devices

Getting input values

See: https://developer.apple.com/documentation/GameController/GCMouse

func GCMouseFromID

func GCMouseFromID(id objc.ID) GCMouse

GCMouseFromID constructs a GCMouse from an objc.ID.

An object that represents a physical mouse connected to a device.

func NewGCMouse

func NewGCMouse() GCMouse

NewGCMouse creates a new GCMouse instance.

func (GCMouse) Autorelease

func (g GCMouse) Autorelease() GCMouse

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.

See: https://developer.apple.com/documentation/Foundation/NSNotification/Name-swift.struct/GCMouseDidBecomeCurrent

func (GCMouse) GCMouseDidConnect

func (g GCMouse) GCMouseDidConnect() foundation.NSString

A notification that posts after a mouse connects to the device.

See: https://developer.apple.com/documentation/Foundation/NSNotification/Name-swift.struct/GCMouseDidConnect

func (GCMouse) GCMouseDidDisconnect

func (g GCMouse) GCMouseDidDisconnect() foundation.NSString

A notification that posts after a mouse disconnects from the device.

See: https://developer.apple.com/documentation/Foundation/NSNotification/Name-swift.struct/GCMouseDidDisconnect

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.

See: https://developer.apple.com/documentation/Foundation/NSNotification/Name-swift.struct/GCMouseDidStopBeingCurrent

func (GCMouse) HandlerQueue

func (g GCMouse) 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 (GCMouse) Init

func (g GCMouse) Init() GCMouse

Init initializes the instance.

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

func (g GCMouse) ProductCategory() string

The product category that identifies the type of controller.

See: https://developer.apple.com/documentation/GameController/GCDevice/productCategory

func (GCMouse) SetHandlerQueue

func (o GCMouse) 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 (GCMouse) VendorName

func (g GCMouse) 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 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

Accessing Buttons

Scrolling

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) Init

func (g GCMouseInput) Init() GCMouseInput

Init initializes the instance.

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

Accessing elements by key and 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

Autorelease adds the receiver to the current autorelease pool.

func (GCPhysicalInputElementCollection) Count

The number of elements in the collection.

See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElementCollection-c.class/count

func (GCPhysicalInputElementCollection) ElementEnumerator

Returns an enumerator to iterate the elements in the collection.

Return Value

An enumerator for the collection.

See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElementCollection-c.class/elementEnumerator

func (GCPhysicalInputElementCollection) ElementForAlias

Returns the element in the collection that uses the specified alias.

alias: An alias for the element.

Return Value

An element in the collection.

See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElementCollection-c.class/elementForAlias:

func (GCPhysicalInputElementCollection) Init

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.

See: https://developer.apple.com/documentation/GameController/GCPhysicalInputElementCollection-c.class/objectForKeyedSubscript:

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

Alloc allocates memory for a new instance of the class.

func (GCPhysicalInputElementCollectionClass) 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

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

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 (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 (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

Getting change information

Accessing elements by name or key

Getting elements by type

Setting snapshot values

Remapping input elements

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) AllDpads

The directional pads in the profile.

See: https://developer.apple.com/documentation/GameController/GCPhysicalInputProfile/allDpads

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

Autorelease adds the receiver to the current autorelease pool.

func (GCPhysicalInputProfile) Axes

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

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

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

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

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.

See: https://developer.apple.com/documentation/Foundation/NSNotification/Name-swift.struct/GCControllerUserCustomizationsDidChange

func (GCPhysicalInputProfile) Gamepad

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

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.

See: https://developer.apple.com/documentation/GameController/GCPhysicalInputProfile/mappedElementAlias(forPhysicalInputName:)

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.

See: https://developer.apple.com/documentation/GameController/GCPhysicalInputProfile/mappedPhysicalInputNames(forElementAlias:)

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.

See: https://developer.apple.com/documentation/GameController/GCPhysicalInputProfile/setStateFromPhysicalInput(_:)

func (GCPhysicalInputProfile) SetValueDidChangeHandler

func (GCPhysicalInputProfile) Touchpads

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

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.

See: https://developer.apple.com/documentation/GameController/GCPhysicalInputProfile/valueDidChangeHandler

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

Alloc allocates memory for a new instance of the class.

func (GCPhysicalInputProfileClass) 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

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 (GCPhysicalInputSourceObject) Direction

The directional input, if any, that a physical input source involves.

Discussion

If this property is `nil`, the physical input source doesn’t involve directional input.

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

	// A Boolean value that indicates whether the user presses the button.
	//
	// See: https://developer.apple.com/documentation/GameController/GCPressedStateInput/isPressed
	Pressed() 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

	// 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 (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.

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.

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.

Discussion

This property isn’t a specific date and time. To determine the time between changes, subtract a previous value from the current value.

See: https://developer.apple.com/documentation/GameController/GCPressedStateInput/lastPressedStateTimestamp

func (GCPressedStateInputObject) Pressed added in v0.6.4

func (o GCPressedStateInputObject) Pressed() bool

A Boolean value that indicates whether the user presses the button.

See: https://developer.apple.com/documentation/GameController/GCPressedStateInput/isPressed

func (GCPressedStateInputObject) Sources

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

Getting events

Accessing the controller profile

Creating snapshots

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) 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.

See: https://developer.apple.com/documentation/Foundation/NSNotification/Name-swift.struct/GCRacingWheelDidConnect

func (GCRacingWheel) GCRacingWheelDidDisconnect

func (g GCRacingWheel) GCRacingWheelDidDisconnect() foundation.NSString

A notification that posts after a racing wheel controller disconnects from the device.

See: https://developer.apple.com/documentation/Foundation/NSNotification/Name-swift.struct/GCRacingWheelDidDisconnect

func (GCRacingWheel) HandlerQueue

func (g GCRacingWheel) 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 (GCRacingWheel) Init

func (g GCRacingWheel) Init() GCRacingWheel

Init initializes the instance.

func (GCRacingWheel) IsAcquired added in v0.6.5

func (g GCRacingWheel) IsAcquired() 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) IsSnapshot added in v0.6.5

func (g GCRacingWheel) IsSnapshot() 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) 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 (o GCRacingWheel) 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 (GCRacingWheel) VendorName

func (g GCRacingWheel) 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

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

Polling for input

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

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() func(objc.ID)

A block that the profile calls when an element’s value changes.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInput/elementValueDidChangeHandler

func (GCRacingWheelInput) Init

Init initializes the instance.

func (GCRacingWheelInput) InputStateAvailableHandler

func (g GCRacingWheelInput) InputStateAvailableHandler() func(objc.ID)

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

func (GCRacingWheelInput) InputStateQueueDepth

func (g GCRacingWheelInput) InputStateQueueDepth() int

The maximum number of input values that the queue stores.

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.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInput/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

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

Accessing elements by name

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

Autorelease adds the receiver to the current autorelease pool.

func (GCRacingWheelInputState) Axes added in v0.6.4

The device’s axes as key-value pairs for lookup by name.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/axes-80rx

func (GCRacingWheelInputState) BrakePedal

The controller’s brake pedal element.

See: https://developer.apple.com/documentation/GameController/GCRacingWheelInputState/brakePedal

func (GCRacingWheelInputState) Buttons added in v0.6.4

The device’s buttons as key-value pairs for lookup by name.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/buttons-3257g

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) Dpads added in v0.6.4

The device’s directional pads as key-value pairs for lookup by name.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/dpads-5yr9x

func (GCRacingWheelInputState) Elements added in v0.6.4

The device’s elements as key-value pairs for lookup by name.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/elements-1shp2

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

Init initializes the instance.

func (GCRacingWheelInputState) LastEventLatency

func (g GCRacingWheelInputState) LastEventLatency() float64

The time in seconds between the last event and the current time.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/lastEventLatency

func (GCRacingWheelInputState) LastEventTimestamp

func (g GCRacingWheelInputState) LastEventTimestamp() float64

The time of the most recent event.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/lastEventTimestamp

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

The controller’s gear shift element.

See: https://developer.apple.com/documentation/GameController/GCRacingWheelInputState/shifter

func (GCRacingWheelInputState) Switches added in v0.6.4

The device’s switches as key-value pairs for lookup by name.

See: https://developer.apple.com/documentation/GameController/GCDevicePhysicalInputState/switches-6bws2

func (GCRacingWheelInputState) Wheel

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

Alloc allocates memory for a new instance of the class.

func (GCRacingWheelInputStateClass) 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

	// A Boolean value that indicates whether the input provides analog values.
	//
	// See: https://developer.apple.com/documentation/GameController/GCRelativeInput/isAnalog
	Analog() bool

	// The most recent amount of change in values that the profile records.
	//
	// See: https://developer.apple.com/documentation/GameController/GCRelativeInput/delta
	Delta() 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) Analog added in v0.6.4

func (o GCRelativeInputObject) Analog() bool

A Boolean value that indicates whether the input provides analog values.

See: https://developer.apple.com/documentation/GameController/GCRelativeInput/isAnalog

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) 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.

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.

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.

Discussion

This property isn’t a specific date and time. To determine the time between delta values, subtract a previous value from the current value.

See: https://developer.apple.com/documentation/GameController/GCRelativeInput/lastDeltaTimestamp

func (GCRelativeInputObject) Sources

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

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

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

Autorelease adds the receiver to the current autorelease pool.

func (GCSteeringWheelElement) Init

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.

See: https://developer.apple.com/documentation/GameController/GCSteeringWheelElement/maximumDegreesOfRotation

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

Alloc allocates memory for a new instance of the class.

func (GCSteeringWheelElementClass) 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

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

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

	// A Boolean value that indicates whether the position change is sequential.
	//
	// See: https://developer.apple.com/documentation/GameController/GCSwitchPositionInput/isSequential
	IsSequential() bool

	// 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
	Sequential() 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

	// 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 (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.

Discussion

For non-sequential switches, this property is always true.

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.

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.

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.

Discussion

This property isn’t a specific date and time. To determine the time between positions, subtract a previous value from the current value.

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) PositionRange

The range of possible values for the switch.

See: https://developer.apple.com/documentation/GameController/GCSwitchPositionInput/positionRange

func (GCSwitchPositionInputObject) Sequential added in v0.6.4

func (o GCSwitchPositionInputObject) Sequential() bool

A Boolean value that indicates whether the position change is sequential.

Discussion

A sequential gear shift requires the user to move through the gears in sequence.

See: https://developer.apple.com/documentation/GameController/GCSwitchPositionInput/isSequential

func (GCSwitchPositionInputObject) Sources

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

	// A Boolean value that indicates whether the user touches the button.
	//
	// See: https://developer.apple.com/documentation/GameController/GCTouchedStateInput/isTouched
	Touched() 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

	// 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 (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.

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.

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.

Discussion

This property isn’t a specific date and time. To determine the time between changes, subtract a previous value from the current value.

See: https://developer.apple.com/documentation/GameController/GCTouchedStateInput/lastTouchedStateTimestamp

func (GCTouchedStateInputObject) Sources

One or more physical actions the user performs to manipulate the input.

See: https://developer.apple.com/documentation/GameController/GCTouchedStateInput/sources

func (GCTouchedStateInputObject) Touched added in v0.6.4

func (o GCTouchedStateInputObject) Touched() bool

A Boolean value that indicates whether the user touches the button.

Discussion

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/GCTouchedStateInput/isTouched

type GCUIEventTypes

type GCUIEventTypes uint

See: https://developer.apple.com/documentation/GameController/GCUIEventTypes

const (
	GCUIEventTypeGamepad GCUIEventTypes = 0
	GCUIEventTypeNone    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

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 GCSystemGestureStateDisabled.

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

	// 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.
	IsAttachedToDevice() 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.
	IsSnapshot() 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.IsAttachedToDevice]: 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.IsSnapshot]: 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.
	IsTouched() bool
	// A Boolean value that indicates whether the user is pressing the button.
	IsPressed() 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.IsTouched]: A Boolean value that indicates whether the user is touching the button.
  • [IGCControllerButtonInput.IsPressed]: 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.
	IsAnalog() 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.
	IsBoundToSystemGesture() 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.IsAnalog]: 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.IsBoundToSystemGesture]: 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

	// 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

	// A block that the profile calls when an element’s value changes.
	ElementValueDidChangeHandler() func(objc.ID)
	// The block that the profile calls when Game Controller adds an input state to the queue.
	InputStateAvailableHandler() func(objc.ID)
	// The dispatch queue that the system uses for callbacks.
	Queue() dispatch.Queue
	Elements() IGCPhysicalInputElementCollection
	Axes() IGCPhysicalInputElementCollection
	Buttons() IGCPhysicalInputElementCollection
	Dpads() IGCPhysicalInputElementCollection
	Switches() IGCPhysicalInputElementCollection
}

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) objectivec.IObject
	// 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
	SetAnalog(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

	// 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

	// 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.
	IsAnyKeyPressed() 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.IsAnyKeyPressed]: 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

	// 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

	// 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.
	IsAcquired() 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.
	IsSnapshot() 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.IsAcquired]: 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.IsSnapshot]: 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

	// A block that the profile calls when an element’s value changes.
	ElementValueDidChangeHandler() func(objc.ID)
	// The block that the profile calls when Game Controller adds an input state to the queue.
	InputStateAvailableHandler() func(objc.ID)
	// The maximum number of input values that the queue stores.
	InputStateQueueDepth() int
	// The dispatch queue that the system uses for callbacks.
	Queue() dispatch.Queue
	Elements() IGCPhysicalInputElementCollection
	Axes() IGCPhysicalInputElementCollection
	Buttons() IGCPhysicalInputElementCollection
	Dpads() IGCPhysicalInputElementCollection
	Switches() IGCPhysicalInputElementCollection
}

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

	// 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

	// 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
	// The share button on an Xbox Series X|S controller or later.
	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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL