struct

Espresso::GamepadState

Inherits Struct / Value / Object

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.

Instance methods

a

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

a?

Indicates whether the button is currently pressed.

axes

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

Source
b

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

b?

Indicates whether the button is currently pressed.

back

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

back?

Indicates whether the button is currently pressed.

buttons

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

Source
circle

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

circle?

Indicates whether the button is currently pressed.

cross

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

cross?

Indicates whether the button is currently pressed.

dpad_down

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

dpad_down?

Indicates whether the button is currently pressed.

dpad_left

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

dpad_left?

Indicates whether the button is currently pressed.

dpad_right

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

dpad_right?

Indicates whether the button is currently pressed.

dpad_up

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

dpad_up?

Indicates whether the button is currently pressed.

guide

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

guide?

Indicates whether the button is currently pressed.

left_bumper

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

left_bumper?

Indicates whether the button is currently pressed.

left_thumb

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

left_thumb?

Indicates whether the button is currently pressed.

left_trigger

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

left_x

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

left_y

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

right_bumper

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

right_bumper?

Indicates whether the button is currently pressed.

right_thumb

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

right_thumb?

Indicates whether the button is currently pressed.

right_trigger

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

right_x

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

right_y

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

square

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

square?

Indicates whether the button is currently pressed.

start

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

start?

Indicates whether the button is currently pressed.

to_unsafe

Returns the underlying GLFW gamepad state structure.

Source
triangle

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

triangle?

Indicates whether the button is currently pressed.

x

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

x?

Indicates whether the button is currently pressed.

y

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

y?

Indicates whether the button is currently pressed.