cubos::core::io::GamepadState struct

Holds the state of a gamepad.

Public functions

auto pressed(GamepadButton button) const -> bool
Checks if a button is pressed.
auto axis(GamepadAxis axis) const -> float
Gets the value of an axis.

Public variables

bool buttons
Which buttons are pressed, indexed by GamepadButton.
float axes
Values of the axes, indexed by GamepadAxis.

Function documentation

bool cubos::core::io::GamepadState::pressed(GamepadButton button) const

Checks if a button is pressed.

Parameters
button Button to check.
Returns Whether it is pressed or not.

float cubos::core::io::GamepadState::axis(GamepadAxis axis) const

Gets the value of an axis.

Parameters
axis Axis to get the value of.
Returns Value of the axis.