GCControllerAxisInput Class Reference

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

Overview

A GCControllerAxisInput element measures movement along a particular axis. An axis element is always an analog element.

Tasks

Polling the Axis’ Value

Receiving Notifications When the Axis’ Value Changes

Properties

value

The current value of the axis. (read-only)

@property(readonly) float value
Discussion

On a physical controller, it is common for a portion of the physical control’s moment to be ignored near its neutral position. This part of the control is known as its deadzone. The GCControllerAxisInput element handles the deadzone and other physical constraints of the hardware control and computes a normalized value. The value is in a range from -1 to 1. If the value is 0, then the movement is in the deadzone. A non-zero value indicates the moment is outside of the deadzone. The value is normalized so that no values are lost because of the deadzone.

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

valueChangedHandler

A handler to be called when the axis changes value.

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

Constants

GCControllerAxisValueChangedHandler

The signature for the block executed when an axis changes values.

typedef void (^GCControllerAxisValueChangedHandler)(GCControllerAxisInput *axis, float value)
Discussion

The block parameters are defined as follows:

axis

The axis element whose value changed.

value

The new value.

This block type is used by the valueChangedHandler property.

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