Jazz2::Input::ControlScheme class

Provides access to a user configured control scheme.

Holds the global keyboard and gamepad bindings for all local players and translates raw key and gamepad state into processed per-player input and menu navigation. Bindings can be reset to defaults and individual mapping targets created for keys, buttons and axes.

Public static functions

static void Reset()
Resets all bindings to default.
static auto FetchProcessedInput(std::int32_t playerIndex, const BitArray& pressedKeys, const ArrayView<const JoyMappedState*> joyStates, std::uint64_t prevPressedActions, bool analogAsButtons = true) -> ProcessedInput
Fetches processed standard input for specified player according to the current bindings.
static auto FetchNavigation(const BitArray& pressedKeys, const ArrayView<const JoyMappedState*> joyStates, NavigationFlags flags = NavigationFlags::AllowAll) -> std::uint32_t
Fetches navigation input according to the current bindings.
static auto GetAllMappings() -> ArrayView<ControlSchemeMapping>
Returns the entire mapping configuration.
static auto GetMappings(std::int32_t playerIdx) -> ArrayView<ControlSchemeMapping>
Returns a mapping configuration for a given player index.
static auto GetGamepadForPlayer(std::int32_t playerIdx) -> std::int32_t
Returns a gamepad index for a given player index.
static auto ContainsTarget(PlayerAction action, MappingTarget target) -> bool
Returns true if the action of any player is bound the specified target.
static auto CreateTarget(Keys key) -> MappingTarget
Creates mapping target for a given key.
static auto CreateTarget(std::uint32_t gamepadIndex, ButtonName button) -> MappingTarget
Creates mapping target for a given gamepad button.
static auto CreateTarget(std::uint32_t gamepadIndex, AxisName axis, bool negative = false) -> MappingTarget
Creates mapping target for a given gamepad axis.

Constructors, destructors, conversion operators

ControlScheme() deleted
~ControlScheme() deleted

Constants

static std::int32_t MaxSupportedPlayers constexpr
Maximum number of supported local players.
static std::int32_t MaxConnectedGamepads constexpr
Maximum number of supported connected gamepads.