GameController lets your app discover, connect to, and read input from game controllers, remotes, keyboards, and mice across iOS, macOS, tvOS, and visionOS. You work with a GCController to access its profiles, reading buttons through GCControllerButtonInput, analog sticks and triggers through GCControllerAxisInput and GCControllerDirectionPad, and extended layouts via GCExtendedGamepad, including device-specific types such as GCDualSenseGamepad and GCDualShockGamepad. Beyond input, the framework exposes device features like GCDeviceBattery, GCDeviceLight, and GCDeviceHaptics for haptic feedback, and supports adaptive triggers through GCDualSenseAdaptiveTrigger.
Essentials 4
Discover, connect to, and identify the controllers and devices providing input to your app.
- ClGCControlleriOS 7.0+Controllers are available to an application that links to GameController.framework. There are 2 ways to access controllers
- PrGCDeviceiOS 14.0+A protocol that defines the common properties of all input devices, such as controllers and keyboards.
- ClGCDeviceTypeA class representing a type of spatial accessory.
- EnGCControllerPlayerIndexiOS 7.0+This is the player index that a connected controller will have if it has never been assigned a player index on the current system.
Gamepad Profiles 4
Standard gamepad layouts that expose buttons, sticks, triggers, and direction pads across device families.
- ClGCExtendedGamepadiOS 7.0+An object that represents the standard extended gamepad profile with two sticks, triggers, and a full button set.
- ClGCMicroGamepadiOS 9.0+An object that represents the micro gamepad profile used by remotes and minimal controllers.
- ClGCDirectionalGamepadiOS 14.3+Directional Gamepad profile.
- ClGCGamepadAn object that represents the legacy standard gamepad profile with a direction pad and face and shoulder buttons.
Device-Specific Controllers 4
Profiles tailored to specific hardware such as DualSense, DualShock, and Xbox controllers.
- ClGCDualSenseGamepadiOS 14.5+The GCDualSenseGamepad profile represents any supported DualSense controller.
- ClGCDualShockGamepadiOS 14.0+The GCDualShockGamepad profile represents any supported DualShock 4 controller.
- ClGCXboxGamepadiOS 14.0+The GCXboxGamepad profile represents any supported Xbox controller.
- ClGCDualSenseAdaptiveTriggeriOS 14.5+DualSense triggers are required to be analog inputs. Common uses would be acceleration and decelleration in a driving game for example.
Reading Input Elements 8
Read values from individual controller elements like buttons, axes, direction pads, and touchpads.
- ClGCControllerElementiOS 7.0+Every controller element knows which collection it belongs to and whether its input value is analog or digital.
- ClGCControllerButtonInputiOS 7.0+An object that reads the pressed state and analog value of a controller button.
- ClGCControllerAxisInputiOS 7.0+An object that reads the value of a single analog axis, such as a trigger or one dimension of a stick.
- ClGCControllerDirectionPadiOS 7.0+A direction pad is a common grouping of 2 axis inputs where the input can also be interpreted as 2 sets of mutually exclusive button pairs.
- ClGCControllerTouchpadiOS 13.0+A touchpad is a touch-based two axis input with a notion of "touch state". It keeps track of
- ClGCPhysicalInputProfileiOS 14.0+A game controller profile representing physical buttons, thumbsticks, dpads, etc... on a controller.
- ClGCControllerLiveInputiOS 17.0+An object that provides continuously updated input from a connected controller.
- ClGCControllerInputStateiOS 17.0+An object that captures the state of a controller's input elements at a moment in time.
Physical Input Model 9
Protocols and types that describe controller elements, their state, and changes in a hardware-agnostic way.
- PrGCDevicePhysicalInputiOS 16.0+An objecting conforming to \c GCDevicePhysicalInput provides properties and
- PrGCDevicePhysicalInputStateiOS 16.0+An object conforming to \c GCDevicePhysicalInputState contains the state of
- PrGCDevicePhysicalInputStateDiffiOS 16.0+An object conforming to the \c GCDevicePhysicalInputStateDiff protocol
- PrGCPhysicalInputElementiOS 16.0+The \c GCPhysicalInputElement protocol is a base protocol for specific types
- StGCPhysicalInputElementCollectioniOS 16.0+A structure that holds a collection of a device's physical input elements keyed by name.
- PrGCPhysicalInputSourceiOS 17.0+A description of the actual physical input element that a user interacts
- PrGCPhysicalInputExtentsiOS 26.2+Physical extents scale the normalized value reported by `GCLinearInput`
- EnGCDevicePhysicalInputElementChangeiOS 16.0+Constants that describe how a physical input element changed between states.
- StGCPhysicalInputSourceDirectioniOS 17.0+One or more directions associated with a \c GCPhysicalInputSource.
Element Protocols 11
Protocols that classify input elements by their behavior, such as buttons, axes, switches, and direction pads.
- PrGCButtonElementiOS 16.0+An object conforming to \c GCButtonElement represents a momentary switch,
- PrGCAxisElementiOS 16.0+A protocol for input elements that behave as one-dimensional analog axes.
- PrGCAxis2DInputiOS 17.4+An object conforming to \c GCAxis2DInput represents an input that produces a
- PrGCAxisInputiOS 16.0+An object conforming to \c GCAxisInput represents an input that produces
- PrGCDirectionPadElementiOS 16.0+An object conforming to \c GCDirectionPadElement represents a four-way
- PrGCSwitchElementiOS 16.0+An object conforming to \c GCSwitchElement represents a latching switch.
- PrGCLinearInputiOS 16.0+An object conforming to \c GCLinearInput represents an input that produces
- PrGCPressedStateInputiOS 16.0+An object conforming to \c GCPressedStateInput represents the pressed state of
- PrGCTouchedStateInputiOS 16.0+An object conforming to \c GCTouchedStateInput represents the touched state of
- PrGCRelativeInputiOS 16.0+An object conforming to \c GCRelativeInput represents an input that reports
- PrGCSwitchPositionInputiOS 16.0+A protocol for reading the discrete position of a switch input.
Element Names 6
Typed identifiers that name standard buttons, axes, direction pads, and switches.
- StGCPhysicalInputElementNameiOS 16.0+A structure that provides typed names for standard physical input elements.
- StGCButtonElementNameiOS 16.0+A structure that provides typed names for standard button input elements.
- StGCAxisElementNameiOS 16.0+A structure that provides typed names for standard axis input elements.
- StGCDirectionPadElementNameiOS 16.0+A structure that provides typed names for standard direction pad input elements.
- StGCSwitchElementNameiOS 16.0+A structure that provides typed names for standard switch input elements.
- PrGCPhysicalInputElementTypedNameiOS 17.0+A type-safe key for accessing elements of a `GCPhysicalInputElementCollection`.
Keyboard and Pointer Input 8
Read input from connected keyboards, mice, styluses, and on-screen cursors.
- ClGCKeyboardiOS 14.0+GCKeyboard is available to an application that links to GameController.framework
- ClGCKeyboardInputiOS 14.0+Keyboard profile. Contains the current state of buttons specified in GCKeyCodes.h.
- StGCKeyCodeiOS 14.0+A set of low level key codes that can be used to access keyboard buttons
- ClGCMouseiOS 14.0+Mice are available to an application that links to GameController.framework. There are 2 ways to access mice
- ClGCMouseInputiOS 14.0+Mouse profile that represent a physical mouse object with two axis cursor, two axis scroll,
- ClGCDeviceCursoriOS 14.0+A cursor is a Direction Pad that has its axis extended from [-1; 1] to [width; height] range
- ClGCStylusAn object that represents a physical stylus connected to the device.
- ClGCSpatialAccessoryAn object that represents a spatial accessory and reports its tracked input.
Motion Sensing 6
Read accelerometer, gyroscope, and attitude data from controllers that report motion.
- ClGCMotioniOS 8.0+A profile for getting motion input from a controller that has the ability to measure acceleration
- StGCAccelerationiOS 8.0+A 3 dimensional acceleration vector measured as scalar multiples of earth's gravitational acceleration, G.
- StGCRotationRateiOS 8.0+A structure containing 3-axis rotation rate data.
- StGCEulerAnglesiOS 8.0+A structure containing 3-axis rotation data. The angles are rotated in order or pitch then yaw then roll.
- StGCQuaternioniOS 8.0+Represents a quaternion (one way of parameterizing attitude).
- StGCPoint2iOS 17.4+A structure that represents a two-dimensional point with x and y components.
Device Features 5
Access controller hardware features such as the battery, light, color, and haptic feedback.
- ClGCDeviceBatteryiOS 14.0+A controller battery is an abstract representation of the battery level and battery status of a GCController instance.
- ClGCDeviceLightiOS 14.0+A controller light is an abstract representation of the light-emitting capabilities of a GCController instance.
- ClGCColoriOS 14.0+Represents a color used by a GCDeviceLight.
- ClGCDeviceHapticsiOS 14.0+An object that creates and plays haptic feedback on a controller that supports it.
- StGCHapticsLocalityiOS 14.0+A GCHapticsLocality represents the locations of haptic actuators on a
Snapshots 10
Capture and serialize the state of a gamepad profile for recording, replay, or transmission.
- ClGCExtendedGamepadSnapshotA GCExtendedGamepadSnapshot snapshot is a concrete GCExtendedGamepad implementation. It can be used directly in an
- StGCExtendedGamepadSnapshotDataA structure that holds the serialized state of an extended gamepad profile.
- StGCExtendedGamepadSnapShotDataV100A structure that holds version 1.0.0 serialized state of an extended gamepad profile.
- EnGCExtendedGamepadSnapshotDataVersionConstants that identify the version of an extended gamepad snapshot data format.
- ClGCMicroGamepadSnapshotA GCMicroGamepadSnapshot snapshot is a concrete GCMicroGamepad implementation. It can be used directly in an
- StGCMicroGamepadSnapshotDataA structure that holds the serialized state of a micro gamepad profile.
- StGCMicroGamepadSnapShotDataV100A structure that holds version 1.0.0 serialized state of a micro gamepad profile.
- EnGCMicroGamepadSnapshotDataVersionConstants that identify the version of a micro gamepad snapshot data format.
- ClGCGamepadSnapshotA GCGamepadSnapshot snapshot is a concrete GCGamepad implementation. It can be used directly in an
- StGCGamepadSnapShotDataV100A structure that holds version 1.0.0 serialized state of a standard gamepad profile.
Event Handling and Settings 5
Route controller events through your app and manage controller-related system settings.
- ClGCEventViewControlleriOS 9.0+A view controller subclass that allows fine grained control of the user interface system's handling
- ClGCEventInteractioniOS 18.0+An interaction that indicates the view's intent to receive game controller
- ClGCControllerHomeButtonSettingsManageriOS 27.0+Access the game controller system Home button settings.
- StGCUIEventTypesiOS 18.0+Constants that represent types of events.
- StGameControllerEventHandlingOptionsAn option set that configures how the system delivers game controller events to your app.
Type Aliases 16
- TyGCControllerAxisValueChangedHandlerSet this block if you want to be notified when the value on this axis changes.
- TyGCControllerButtonValueChangedHandlerSet this block if you want to be notified when the value on this button changes.
- TyGCControllerButtonTouchedChangedHandlerSet this block if you want to be notified when the touched state on this button changes.
- TyGCControllerDirectionPadValueChangedHandlerSet this block if you want to be notified when the value on this axis changes.
- TyGCControllerTouchpadHandlerSet this block if you want to be notified when an axis or the touch state changes.
- TyGCExtendedGamepadValueChangedHandlerSet this block if you want to be notified when a value on a element changed. If multiple elements have changed this block will be called
- TyGCGamepadValueChangedHandlerSet this block if you want to be notified when a value on a element changed. If multiple elements have changed this block will be called
- TyGCKeyboardValueChangedHandlerSet this block if you want to be notified when a value of a key changed. If multiple keys have changed this block will be called
- TyGCMicroGamepadValueChangedHandlerSet this block if you want to be notified when a value on a element changed. If multiple elements have changed this block will be called
- TyGCMotionValueChangedHandlerCalled whenever a motion value changed.
- TyGCMouseMovedSet this block if you want to be notified when the mouse was moved
- TyGCDeviceElement
- TyGCDeviceButtonInput
- TyGCDeviceAxisInput
- TyGCDeviceDirectionPad
- TyGCDeviceTouchpad