|
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++.
|
Action binding system for the ASW library. More...
Go to the source code of this file.
Classes | |
| struct | asw::input::KeyBinding |
| Binding to a keyboard key. More... | |
| struct | asw::input::MouseButtonBinding |
| Binding to a mouse button. More... | |
| struct | asw::input::ControllerButtonBinding |
| Binding to a controller (gamepad) button. More... | |
| struct | asw::input::ControllerAxisBinding |
| Binding to a controller axis, activated when the axis exceeds a threshold. More... | |
Namespaces | |
| namespace | asw |
| namespace | asw::input |
Typedefs | |
| using | asw::input::ActionBinding = std::variant<KeyBinding, MouseButtonBinding, ControllerButtonBinding, ControllerAxisBinding> |
| A single input binding — keyboard, mouse button, controller button, or controller axis. | |
Functions | |
| void | asw::input::bind_action (std::string_view name, ActionBinding binding) |
| Register a binding for a named action. | |
| void | asw::input::unbind_action (std::string_view name) |
| Remove all bindings for a named action. | |
| void | asw::input::clear_actions () |
| Remove all registered actions and their bindings. | |
| bool | asw::input::get_action_down (std::string_view name) |
| Check if an action was triggered (first pressed) this frame. | |
| bool | asw::input::get_action_up (std::string_view name) |
| Check if an action was released this frame. | |
| bool | asw::input::get_action (std::string_view name) |
| Check if an action is currently held down. | |
| float | asw::input::get_action_strength (std::string_view name) |
| Get the analogue strength of an action (0.0 – 1.0). | |
| void | asw::input::update_actions () |
| Update cached action states from current raw input. | |
Action binding system for the ASW library.
Allows registering named actions backed by one or more mouse, keyboard or controller bindings. Any binding that is active will satisfy the action.
Example:
Definition in file action.h.