GCExtendedGamepad Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/GameController.framework
Availability
Available in iOS 7.0 and later.
Companion guide
Declared in
GCExtendedGamepad.h

Overview

A GCExtendedGamepad object implements a logical profile for a set of gamepad controls. A profile maps the hardware controls of a particular controller to a set of elements usable by your game.

The controls associated with the extended gamepad profile include the following:

../Art/featuresHIDGameControllerExtendedNonFormFittingSample_2x.png

Tasks

Determining the Controller That Owns This Profile

Determining When Any Element in the Profile Changes

Reading Shoulder Button Inputs

Reading Directional Pad Inputs

Reading Face Button Inputs

Reading Thumbstick Inputs

Reading Trigger Inputs

Saving a Snapshot

Properties

buttonA

The bottom face button. (read-only)

@property(readonly) GCControllerButtonInput *buttonA
Discussion

The face buttons in the extended gamepad profile are analog buttons.

Availability
  • Available in iOS 7.0 and later.
Declared In
GCExtendedGamepad.h

buttonB

The right face button. (read-only)

@property(readonly) GCControllerButtonInput *buttonB
Discussion

The face buttons in the extended gamepad profile are analog buttons.

Availability
  • Available in iOS 7.0 and later.
Declared In
GCExtendedGamepad.h

buttonX

The left face button. (read-only)

@property(readonly) GCControllerButtonInput *buttonX
Discussion

The face buttons in the extended gamepad profile are analog buttons.

Availability
  • Available in iOS 7.0 and later.
Declared In
GCExtendedGamepad.h

buttonY

The top face button. (read-only)

@property(readonly) GCControllerButtonInput *buttonY
Discussion

The face buttons in the extended gamepad profile are analog buttons.

Availability
  • Available in iOS 7.0 and later.
Declared In
GCExtendedGamepad.h

controller

The controller this profile is associated with. (read-only)

@property(readonly, assign) GCController *controller
Availability
  • Available in iOS 7.0 and later.
Declared In
GCExtendedGamepad.h

dpad

The d-pad element. (read-only)

@property(readonly) GCControllerDirectionPad *dpad
Discussion

The directional pad in the extended gamepad profile is an analog control.

Availability
  • Available in iOS 7.0 and later.
Declared In
GCExtendedGamepad.h

leftShoulder

The left shoulder button element. (read-only)

@property(readonly) GCControllerButtonInput *leftShoulder
Discussion

The shoulder buttons in the extended gamepad profile are analog buttons.

Availability
  • Available in iOS 7.0 and later.
Declared In
GCExtendedGamepad.h

leftThumbstick

The left thumbstick element. (read-only)

@property(readonly) GCControllerDirectionPad *leftThumbstick
Discussion

The thumbsticks in the extended gamepad profile are analog buttons.

Availability
  • Available in iOS 7.0 and later.
Declared In
GCExtendedGamepad.h

leftTrigger

The left trigger element. (read-only)

@property(readonly) GCControllerButtonInput *leftTrigger
Discussion

The triggers in the extended gamepad profile are analog buttons.

Availability
  • Available in iOS 7.0 and later.
Declared In
GCExtendedGamepad.h

rightShoulder

The right shoulder button element. (read-only)

@property(readonly) GCControllerButtonInput *rightShoulder
Discussion

The shoulder buttons in the extended gamepad profile are analog buttons.

Availability
  • Available in iOS 7.0 and later.
Declared In
GCExtendedGamepad.h

rightThumbstick

The right thumbstick element. (read-only)

@property(readonly) GCControllerDirectionPad *rightThumbstick
Discussion

The thumbsticks in the extended gamepad profile are analog buttons.

Availability
  • Available in iOS 7.0 and later.
Declared In
GCExtendedGamepad.h

rightTrigger

The right trigger element. (read-only)

@property(readonly) GCControllerButtonInput *rightTrigger
Discussion

The triggers in the extended gamepad profile are analog buttons.

Availability
  • Available in iOS 7.0 and later.
Declared In
GCExtendedGamepad.h

valueChangedHandler

A block called when any element in the profile changes values.

@property(copy) GCExtendedGamepadValueChangedHandler valueChangedHandler
Availability
  • Available in iOS 7.0 and later.
Declared In
GCExtendedGamepad.h

Instance Methods

saveSnapshot

Saves a snapshot of all of the profile’s elements.

- (GCExtendedGamepadSnapshot *)saveSnapshot
Return Value

A snapshot object that contains the current controller state.

Availability
  • Available in iOS 7.0 and later.
Declared In
GCExtendedGamepad.h

Constants

GCExtendedGamepadValueChangedHandler

Signature for the block executed if any element in the extended gamepad profile changes value.

typedef void (^GCExtendedGamepadValueChangedHandler)(GCExtendedGamepad *gamepad, GCControllerElement *element)
Discussion

The block parameters are defined as follows:

gamepad

The profile whose value changed.

element

The element whose value changed.

If multiple elements change values at the same time, the block is called once for each element that changed. The block is called only for the elements directly attached to the profile object; if a child element of one of those elements changes values, the block is called for the parent.

This block type is used by the valueChangedHandler property.

Availability
  • Available in iOS 7.0 and later.
Declared In
GCExtendedGamepad.h