ApolloInput Nova 0.2.0
Standalone virtual gamepad library
Loading...
Searching...
No Matches
apollo::input::GamepadState Struct Reference

One complete gamepad input report. More...

#include <gamepad.hpp>

Public Member Functions

bool pressed (Button button) const
 Check whether a button is pressed.
void set (Button button, bool pressed)
 Set or clear a button bit.
void clear ()
 Reset all buttons, triggers, and sticks.

Public Attributes

std::uint32_t buttons = 0
 Bit mask of Button values.
std::uint8_t left_trigger = 0
 0-255.
std::uint8_t right_trigger = 0
 0-255.
std::int16_t left_x = 0
 -32768 to 32767.
std::int16_t left_y = 0
 -32768 to 32767.
std::int16_t right_x = 0
 -32768 to 32767.
std::int16_t right_y = 0
 -32768 to 32767.

Detailed Description

One complete gamepad input report.

Definition at line 105 of file gamepad.hpp.

Member Function Documentation

◆ clear()

void apollo::input::GamepadState::clear ( )
inline

Reset all buttons, triggers, and sticks.

Definition at line 141 of file gamepad.hpp.

◆ pressed()

bool apollo::input::GamepadState::pressed ( Button button) const
inline

Check whether a button is pressed.

Parameters
buttonButton to query.
Returns
True when the button bit is set.

Definition at line 120 of file gamepad.hpp.

◆ set()

void apollo::input::GamepadState::set ( Button button,
bool pressed )
inline

Set or clear a button bit.

Parameters
buttonButton to update.
pressedNew pressed state.

Definition at line 130 of file gamepad.hpp.

Member Data Documentation

◆ buttons

std::uint32_t apollo::input::GamepadState::buttons = 0

Bit mask of Button values.

Definition at line 106 of file gamepad.hpp.

◆ left_trigger

std::uint8_t apollo::input::GamepadState::left_trigger = 0

0-255.

Definition at line 107 of file gamepad.hpp.

◆ left_x

std::int16_t apollo::input::GamepadState::left_x = 0

-32768 to 32767.

Definition at line 109 of file gamepad.hpp.

◆ left_y

std::int16_t apollo::input::GamepadState::left_y = 0

-32768 to 32767.

Definition at line 110 of file gamepad.hpp.

◆ right_trigger

std::uint8_t apollo::input::GamepadState::right_trigger = 0

0-255.

Definition at line 108 of file gamepad.hpp.

◆ right_x

std::int16_t apollo::input::GamepadState::right_x = 0

-32768 to 32767.

Definition at line 111 of file gamepad.hpp.

◆ right_y

std::int16_t apollo::input::GamepadState::right_y = 0

-32768 to 32767.

Definition at line 112 of file gamepad.hpp.


The documentation for this struct was generated from the following file: