struct Espresso::GamepadState

Overview

Describes the input state of a gamepad.

The #guide button may not be available for input as it is often hooked by the system or the Steam client.

Not all devices have all the buttons or axes defined by this type. Unavailable buttons and axes will always report ButtonState::Released and 0.0 respectively.

Defined in:

espresso/gamepad_state.cr

Instance Method Summary

Instance Method Detail

def a #

Gets the state of the button. This will be one of ButtonState::Pressed or ButtonState::Released.


def a? #

Indicates whether the button is currently pressed.


def axes #

The states of each gamepad axis, in the range -1.0 to 1.0 inclusive.


[View source]
def b #

Gets the state of the button. This will be one of ButtonState::Pressed or ButtonState::Released.


def b? #

Indicates whether the button is currently pressed.


def back #

Gets the state of the button. This will be one of ButtonState::Pressed or ButtonState::Released.


def back? #

Indicates whether the button is currently pressed.


def buttons #

The states of each gamepad button, ButtonState::Pressed or ButtonState::Released.


[View source]
def circle #

Gets the state of the button. This will be one of ButtonState::Pressed or ButtonState::Released.


def circle? #

Indicates whether the button is currently pressed.


def cross #

Gets the state of the button. This will be one of ButtonState::Pressed or ButtonState::Released.


def cross? #

Indicates whether the button is currently pressed.


def dpad_down #

Gets the state of the button. This will be one of ButtonState::Pressed or ButtonState::Released.


def dpad_down? #

Indicates whether the button is currently pressed.


def dpad_left #

Gets the state of the button. This will be one of ButtonState::Pressed or ButtonState::Released.


def dpad_left? #

Indicates whether the button is currently pressed.


def dpad_right #

Gets the state of the button. This will be one of ButtonState::Pressed or ButtonState::Released.


def dpad_right? #

Indicates whether the button is currently pressed.


def dpad_up #

Gets the state of the button. This will be one of ButtonState::Pressed or ButtonState::Released.


def dpad_up? #

Indicates whether the button is currently pressed.


def guide #

Gets the state of the button. This will be one of ButtonState::Pressed or ButtonState::Released.


def guide? #

Indicates whether the button is currently pressed.


def left_bumper #

Gets the state of the button. This will be one of ButtonState::Pressed or ButtonState::Released.


def left_bumper? #

Indicates whether the button is currently pressed.


def left_thumb #

Gets the state of the button. This will be one of ButtonState::Pressed or ButtonState::Released.


def left_thumb? #

Indicates whether the button is currently pressed.


def left_trigger #

Gets the state of the axis, in the range -1.0 to 1.0 inclusive.


def left_x #

Gets the state of the axis, in the range -1.0 to 1.0 inclusive.


def left_y #

Gets the state of the axis, in the range -1.0 to 1.0 inclusive.


def right_bumper #

Gets the state of the button. This will be one of ButtonState::Pressed or ButtonState::Released.


def right_bumper? #

Indicates whether the button is currently pressed.


def right_thumb #

Gets the state of the button. This will be one of ButtonState::Pressed or ButtonState::Released.


def right_thumb? #

Indicates whether the button is currently pressed.


def right_trigger #

Gets the state of the axis, in the range -1.0 to 1.0 inclusive.


def right_x #

Gets the state of the axis, in the range -1.0 to 1.0 inclusive.


def right_y #

Gets the state of the axis, in the range -1.0 to 1.0 inclusive.


def square #

Gets the state of the button. This will be one of ButtonState::Pressed or ButtonState::Released.


def square? #

Indicates whether the button is currently pressed.


def start #

Gets the state of the button. This will be one of ButtonState::Pressed or ButtonState::Released.


def start? #

Indicates whether the button is currently pressed.


def to_unsafe : LibGLFW::GamepadState #

Returns the underlying GLFW gamepad state structure.


[View source]
def triangle #

Gets the state of the button. This will be one of ButtonState::Pressed or ButtonState::Released.


def triangle? #

Indicates whether the button is currently pressed.


def x #

Gets the state of the button. This will be one of ButtonState::Pressed or ButtonState::Released.


def x? #

Indicates whether the button is currently pressed.


def y #

Gets the state of the button. This will be one of ButtonState::Pressed or ButtonState::Released.


def y? #

Indicates whether the button is currently pressed.