55 "SteerLeft",
"SteerRight",
"Accelerate",
"Brake",
"Reverse",
56 "GearUp",
"GearDown",
"CockpitCamera",
"BumperCamera",
"ChaseCamera",
57 "PauseMenuUp",
"PauseMenuDown",
"PauseMenuSelect",
"Pause",
"StartOrRespawn",
58 "MenuA",
"MenuB",
"MenuZ",
"MenuStart",
"MenuL",
59 "MenuR",
"MenuCUp",
"MenuCDown",
"MenuCLeft",
"MenuCRight",
60 "MenuDUp",
"MenuDDown",
"MenuDLeft",
"MenuDRight",
"MenuStickLeft",
61 "MenuStickRight",
"MenuStickUp",
"MenuStickDown",
100 "rightshoulder,righttrigger",
128 preset.
values[i] = race[i];
152 "rightshoulder,righttrigger",
153 "leftshoulder,lefttrigger",
167 "rightshoulder,righttrigger",
bool IsAnalog(ControlAction action) const
std::string_view PlayerDevice(std::size_t player) const
ControlBindings(const GameConfig &config)
Load configured assignments and preset defaults.
void Load(const GameConfig &config)
Replace assignments, logging and ignoring invalid sources.
int Read(SDL_Gamepad *gamepad, ControlAction action) const
The settings of BossRally.ini.
Definition config.h:18
Definition assetimport.h:11
constexpr std::size_t RACE_CONTROL_ACTIONS
The actions of a race, from CONTROL_STEER_LEFT to CONTROL_CHASE_CAMERA.
Definition controls.h:115
std::string_view PlayerDevice(std::size_t player)
constexpr std::array< std::string_view, CONTROL_ACTION_COUNT > CONTROL_KEYS
The keys of the Controls section, by ControlAction.
Definition controls.h:54
constexpr int CONTROL_FULL
The magnitude of a button held down or of an axis at its end.
Definition controls.h:245
constexpr std::string_view CONTROL_PRESET_KEY
The key of the Controls section that chooses a preset.
Definition controls.h:65
constexpr ControlPreset DEFAULT_CONTROL_PRESET
The preset of an absent or unknown Preset key.
Definition controls.h:79
constexpr std::array< std::string_view, 2 > PLAYER_DEVICE_KEYS
The keys of the Controls section that choose the input device of each player.
Definition controls.h:70
ControlAction
The actions of a gamepad the Controls section of BossRally.ini binds, in the order of keys.
Definition controls.h:16
@ CONTROL_MENU_STICK_RIGHT
Definition controls.h:47
@ CONTROL_MENU_C_UP
Definition controls.h:38
@ CONTROL_ACTION_COUNT
Definition controls.h:50
@ CONTROL_BRAKE
Definition controls.h:20
@ CONTROL_BUMPER_CAMERA
Definition controls.h:25
@ CONTROL_PAUSE
Definition controls.h:30
@ CONTROL_MENU_R
Definition controls.h:37
@ CONTROL_MENU_Z
Definition controls.h:34
@ CONTROL_MENU_D_LEFT
Definition controls.h:44
@ CONTROL_MENU_C_DOWN
Definition controls.h:39
@ CONTROL_COCKPIT_CAMERA
Definition controls.h:24
@ CONTROL_STEER_LEFT
Definition controls.h:17
@ CONTROL_MENU_D_DOWN
Definition controls.h:43
@ CONTROL_GEAR_DOWN
Definition controls.h:23
@ CONTROL_MENU_A
Definition controls.h:32
@ CONTROL_PAUSE_MENU_DOWN
Definition controls.h:28
@ CONTROL_REVERSE
Definition controls.h:21
@ CONTROL_PAUSE_MENU_SELECT
Definition controls.h:29
@ CONTROL_MENU_L
Definition controls.h:36
@ CONTROL_START_OR_RESPAWN
Definition controls.h:31
@ CONTROL_MENU_B
Definition controls.h:33
@ CONTROL_MENU_STICK_UP
Definition controls.h:48
@ CONTROL_GEAR_UP
Definition controls.h:22
@ CONTROL_MENU_D_UP
Definition controls.h:42
@ CONTROL_MENU_D_RIGHT
Definition controls.h:45
@ CONTROL_CHASE_CAMERA
Definition controls.h:26
@ CONTROL_MENU_C_LEFT
Definition controls.h:40
@ CONTROL_MENU_C_RIGHT
Definition controls.h:41
@ CONTROL_ACCELERATE
Definition controls.h:19
@ CONTROL_MENU_START
Definition controls.h:35
@ CONTROL_MENU_STICK_DOWN
Definition controls.h:49
@ CONTROL_PAUSE_MENU_UP
Definition controls.h:27
@ CONTROL_STEER_RIGHT
Definition controls.h:18
@ CONTROL_MENU_STICK_LEFT
Definition controls.h:46
int ReadControl(SDL_Gamepad *gamepad, ControlAction action)
constexpr std::string_view DEAD_ZONE_KEY
The key of the Controls section with the share of the travel of an axis that reads as 0.
Definition controls.h:67
constexpr std::array< ControlPreset, 7 > CONTROL_PRESETS
The presets the Preset key chooses from, the first the default.
Definition controls.h:144
void LoadControls(const GameConfig &config)
Read the Controls section of config: the preset of the Preset key, the default for an absent or unkno...
bool IsControlAnalog(ControlAction action)
constexpr ControlPreset RaceControlPreset(std::string_view name, const std::array< std::string_view, RACE_CONTROL_ACTIONS > &race)
Definition controls.h:123
A set of bindings of every action, in the syntax of the Controls section.
Definition controls.h:73
std::array< std::string_view, CONTROL_ACTION_COUNT > values
Definition controls.h:75
std::string_view name
Definition controls.h:74
A button or the half of an axis of a gamepad that drives an action.
Definition controls.h:238
bool axis
Definition controls.h:239
int sign
Definition controls.h:241
int index
Definition controls.h:240