ASW Lib
A.D.S. Games SDL Wrapper Library. A library targeted at Allegro4 users who want to switch to SDL3 and use modern c++.
Loading...
Searching...
No Matches
anonymous_namespace{input.cpp} Namespace Reference

Typedefs

using ControllerState
 Data structure for controller state, including button states and axis values.
 

Variables

std::array< SDL_Cursor *, asw::input::NUM_CURSORScursors { nullptr }
 Active cursor stores the current active cursor. It is updated by the core.
 
std::vector< ControllerStatecontroller {}
 Global controller state.
 
std::unordered_map< SDL_JoystickID, uint32_t > controller_id_map {}
 Map of SDL_JoystickID to controller index in the controller vector.
 
asw::input::KeyState keyboard {}
 
asw::input::MouseState mouse {}
 
std::string text_input
 

Typedef Documentation

◆ ControllerState

using anonymous_namespace{input.cpp}::ControllerState
Initial value:
struct ControllerState {
std::array<bool, asw::input::NUM_CONTROLLER_BUTTONS> pressed { false };
std::array<bool, asw::input::NUM_CONTROLLER_BUTTONS> released { false };
std::array<bool, asw::input::NUM_CONTROLLER_BUTTONS> down { false };
bool any_pressed { false };
int last_pressed { -1 };
float dead_zone { 0.25F };
std::array<float, asw::input::NUM_CONTROLLER_AXES> axis { 0 };
SDL_Gamepad* gamepad { nullptr };
std::string name;
}
struct ControllerState { std::array< bool, asw::input::NUM_CONTROLLER_BUTTONS > pressed { false }; std::array< bool, asw::input::NUM_CONTROLLER_BUTTONS > released { false }; std::array< bool, asw::input::NUM_CONTROLLER_BUTTONS > down { false }; bool any_pressed { false }; int last_pressed { -1 }; float dead_zone { 0.25F }; std::array< float, asw::input::NUM_CONTROLLER_AXES > axis { 0 }; SDL_Gamepad *gamepad { nullptr }; std::string name;} ControllerState
Data structure for controller state, including button states and axis values.
Definition input.cpp:11

Data structure for controller state, including button states and axis values.

Definition at line 11 of file input.cpp.

Variable Documentation

◆ controller

std::vector<ControllerState> anonymous_namespace{input.cpp}::controller {}

Global controller state.

Definition at line 31 of file input.cpp.

◆ controller_id_map

std::unordered_map<SDL_JoystickID, uint32_t> anonymous_namespace{input.cpp}::controller_id_map {}

Map of SDL_JoystickID to controller index in the controller vector.

Definition at line 34 of file input.cpp.

◆ cursors

std::array<SDL_Cursor*, asw::input::NUM_CURSORS> anonymous_namespace{input.cpp}::cursors { nullptr }

Active cursor stores the current active cursor. It is updated by the core.

Definition at line 28 of file input.cpp.

◆ keyboard

asw::input::KeyState anonymous_namespace{input.cpp}::keyboard {}

Definition at line 36 of file input.cpp.

◆ mouse

asw::input::MouseState anonymous_namespace{input.cpp}::mouse {}

Definition at line 37 of file input.cpp.

◆ text_input

std::string anonymous_namespace{input.cpp}::text_input

Definition at line 38 of file input.cpp.