Contents

button(forKeyCode:)

Returns the button element for the specified key code.

Declaration

func button(forKeyCode code: GCKeyCode) -> GCControllerButtonInput?

Parameters

  • 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 subscript(_:) notation that you inherit from GCPhysicalInputProfile, as in keyboard[GCKeyUpArrow].

See Also

Accessing Buttons