SteamController

Objective-C

@interface SteamController : GCController

Swift

class SteamController : GCController

Steam Controllers are available to an application that links to SteamController.framework. To detect connected or pairing Steam Controllers, call scanForControllers on SteamControllerManager. Because of the way bluetooth accessories communicate with iOS apps, it’s not possible to detect the connection automatically using public API, so you will need to call scanForControllers accordingly to ensure they’re available when needed (e.g. before starting a game, after a controller is disconnected).

Once connected, they work in the same way as the native GCGameController from GameController.framework, and can be accessed in the same ways:

  1. Querying for the the current array of controllers using [GCController controllers].
  2. Registering for Connection/Disconnection notifications from NSNotificationCenter.

Steam Controllers are represented by the SteamController class, a subclass of GCController. It implements the GCGamepad and GCExtendedGamepad profiles, and has additional functionality relevant to the Steam Controller:

  • Changing the mapping of the trackpads and stick.
  • Requiring clicking on the trackpads for input to be sent.
  • Identifying a controller by playing a tune on it.
  • Handling combinations of Steam button + another button.

Input Mapping

Trackpad Configuration

  • If YES, the input from the left trackpad will only be sent when it is clicked. Otherwise, input will be sent as soon as it’s touched. Defaults to YES.

    Declaration

    Objective-C

    @property (nonatomic) BOOL steamLeftTrackpadRequiresClick;

    Swift

    var steamLeftTrackpadRequiresClick: Bool { get set }
  • If YES, the input from the right trackpad will only be sent when it is clicked. Otherwise, input will be sent as soon as it’s touched. Defaults to YES.

    Declaration

    Objective-C

    @property (nonatomic) BOOL steamRightTrackpadRequiresClick;

    Swift

    var steamRightTrackpadRequiresClick: Bool { get set }

Miscellaneous

  • The CoreBluetooth peripheral associated with this controller.

    Declaration

    Objective-C

    @property (nonatomic, retain, readonly) CBPeripheral *_Nonnull peripheral;

    Swift

    var peripheral: CBPeripheral { get }
  • Battery level (0.0 to 1.0).

    This is derived from the voltage reported by the controller, 1.0 meaning 3 volts. This property is KVO-compliant.

    Declaration

    Objective-C

    @property (nonatomic, readonly) float batteryLevel;

    Swift

    var batteryLevel: Float { get }
  • Plays the identify tune on the controller.

    Declaration

    Objective-C

    - (void)identify;

    Swift

    func identify()
  • Handler for combinations using the Steam button.

    If set, this handler will be called on the handler queue when another button is pressed or released in combination with the Steam button:

    • When the Steam button is pressed, this handler will be called once for every other button that is currently pressed, with isDown=YES.
    • While the Steam button is held down, this handler will be called whenever the buttons change.
    • When the Steam button is released, this handler will be called for every other button that was pressed with isDown=NO, and the other handlers will be updated to reflect the current state of the buttons. If there were no button presses while the Steam button was down, controllerPausedHandler will be called on the main queue.

    Declaration

    Objective-C

    @property (nonatomic, copy, nullable) SteamControllerButtonHandler steamButtonCombinationHandler;

    Swift

    var steamButtonCombinationHandler: SteamControllerButtonHandler? { get set }
  • Sets the mode of the controller.

    Defaults to SteamControllerModeGameController.

    Declaration

    Objective-C

    @property (nonatomic) SteamControllerMode steamControllerMode;

    Swift

    var steamControllerMode: SteamControllerMode { get set }