Aggregates multiple physical inputs into logical actions.
More...
#include <InputSystem.hpp>
|
| void | Update (const float deltaT) override |
| | Updates all input states.
|
| void | BindInput (const std::string &name, const Input &input) |
| | Adds an input to a logical binding.
|
| void | UnbindInput (const std::string &name) |
| | Removes a logical binding entirely.
|
| std::optional< bool > | GetBoolInput (const std::string &name) |
| | Returns the boolean state of a logical binding.
|
| std::optional< float > | GetNumberInput (const std::string &name) |
| | Returns the float axis state of a logical binding.
|
| std::optional< Vec2< float > > | GetVectorInput (const std::string &name) |
| | Returns the vector (position/delta) state of a logical binding.
|
| void | SetScaling (const float scale, const Vec2< float > offset) |
| | Sets mouse scaling and offset for POSITION/DELTA queries.
|
| virtual void | Draw () const |
| | Renders the system.
|
Aggregates multiple physical inputs into logical actions.
Allows binding several keys/buttons/axes to one logical name. Booleans are OR‑combined, axes keep the highest absolute value, vector inputs overwrite.
◆ BindInput()
| void InputSystem::BindInput |
( |
const std::string & | name, |
|
|
const Input & | input ) |
Adds an input to a logical binding.
- Parameters
-
| name | Logical action name. |
| input | Input description (device, key, type). |
Multiple inputs can be bound to the same name.
◆ GetBoolInput()
| std::optional< bool > InputSystem::GetBoolInput |
( |
const std::string & | name | ) |
|
Returns the boolean state of a logical binding.
- Parameters
-
- Returns
- std::nullopt if binding does not exist, otherwise the current boolean state.
◆ GetNumberInput()
| std::optional< float > InputSystem::GetNumberInput |
( |
const std::string & | name | ) |
|
Returns the float axis state of a logical binding.
- Parameters
-
- Returns
- std::nullopt if binding does not exist, otherwise the current axis value.
◆ GetVectorInput()
| std::optional< Vec2< float > > InputSystem::GetVectorInput |
( |
const std::string & | name | ) |
|
Returns the vector (position/delta) state of a logical binding.
- Parameters
-
- Returns
- std::nullopt if binding does not exist, otherwise the current vector.
◆ SetScaling()
| void InputSystem::SetScaling |
( |
const float | scale, |
|
|
const Vec2< float > | offset ) |
Sets mouse scaling and offset for POSITION/DELTA queries.
- Parameters
-
| scale | Scale factor applied to mouse coordinates. |
| offset | Pixel offset added before scaling. |
◆ UnbindInput()
| void InputSystem::UnbindInput |
( |
const std::string & | name | ) |
|
Removes a logical binding entirely.
- Parameters
-
◆ Update()
| void InputSystem::Update |
( |
const float | deltaT | ) |
|
|
overridevirtual |
Updates all input states.
- Parameters
-
| deltaT | Time since last update (unused). |
Reads current mouse position (scaled), then evaluates every bound input and aggregates the results into per‑name InputState structures.
Implements System.
The documentation for this class was generated from the following files: