Configured action sources, player devices, and stick dead zone for an input owner.
More...
#include <controls.h>
Configured action sources, player devices, and stick dead zone for an input owner.
◆ ControlBindings()
| coastline::ControlBindings::ControlBindings |
( |
const GameConfig & | config | ) |
|
|
explicit |
Load configured assignments and preset defaults.
- Parameters
-
| config | Settings with optional Controls assignments, preset, devices, and dead zone. |
◆ Load()
| void coastline::ControlBindings::Load |
( |
const GameConfig & | config | ) |
|
Replace assignments, logging and ignoring invalid sources.
Preset defaults apply only to absent action keys.
- Parameters
-
| config | Settings with optional Controls assignments, preset, devices, and dead zone. |
◆ PlayerDevice()
- Parameters
-
| player | The player index, 0 or 1. |
- Returns
- The lowercase selector, defaulting to 'auto', valid until Load() or destruction.
◆ IsAnalog()
| bool coastline::ControlBindings::IsAnalog |
( |
ControlAction | action | ) |
const |
- Parameters
-
| action | A valid action below CONTROL_ACTION_COUNT. |
- Returns
- Whether at least one configured source for the action is an axis.
◆ Read()
| int coastline::ControlBindings::Read |
( |
SDL_Gamepad * | gamepad, |
|
|
ControlAction | action ) const |
- Parameters
-
| gamepad | The gamepad to query; null produces zero through SDL input queries. |
| action | A valid action below CONTROL_ACTION_COUNT. |
- Returns
- The greatest source magnitude, from 0 to CONTROL_FULL, after dead-zone suppression.
The documentation for this class was generated from the following file: