libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
Loading...
Searching...
No Matches
ControllerDefaultMappings.h
Go to the documentation of this file.
1#pragma once
2
3#include "ship/controller/controldevice/controller/mapping/ControllerDefaultMappings.h"
4
5namespace LUS {
6
19 public:
31 std::unordered_map<CONTROLLERBUTTONS_T, std::unordered_set<Ship::KbScancode>>
32 defaultKeyboardKeyToButtonMappings,
33 std::unordered_map<Ship::StickIndex, std::vector<std::pair<Ship::Direction, Ship::KbScancode>>>
34 defaultKeyboardKeyToAxisDirectionMappings,
35 std::unordered_map<CONTROLLERBUTTONS_T, std::unordered_set<SDL_GamepadButton>> defaultSDLButtonToButtonMappings,
36 std::unordered_map<Ship::StickIndex, std::vector<std::pair<Ship::Direction, SDL_GamepadButton>>>
37 defaultSDLButtonToAxisDirectionMappings,
38 std::unordered_map<CONTROLLERBUTTONS_T, std::vector<std::pair<SDL_GamepadAxis, int32_t>>>
39 defaultSDLAxisDirectionToButtonMappings,
40 std::unordered_map<Ship::StickIndex,
41 std::vector<std::pair<Ship::Direction, std::pair<SDL_GamepadAxis, int32_t>>>>
42 defaultSDLAxisDirectionToAxisDirectionMappings);
43
51
52 private:
57 void
58 SetDefaultKeyboardKeyToButtonMappings(std::unordered_map<CONTROLLERBUTTONS_T, std::unordered_set<Ship::KbScancode>>
59 defaultKeyboardKeyToButtonMappings) override;
60
65 void SetDefaultSDLButtonToButtonMappings(
66 std::unordered_map<CONTROLLERBUTTONS_T, std::unordered_set<SDL_GamepadButton>> defaultSDLButtonToButtonMappings)
67 override;
68
73 void SetDefaultSDLAxisDirectionToButtonMappings(
74 std::unordered_map<CONTROLLERBUTTONS_T, std::vector<std::pair<SDL_GamepadAxis, int32_t>>>
75 defaultSDLAxisDirectionToButtonMappings) override;
76};
77} // namespace LUS
#define CONTROLLERBUTTONS_T
Definition ControllerButtonMapping.h:13
N64-specific controller default mapping configuration.
Definition ControllerDefaultMappings.h:18
ControllerDefaultMappings(std::unordered_map< CONTROLLERBUTTONS_T, std::unordered_set< Ship::KbScancode > > defaultKeyboardKeyToButtonMappings, std::unordered_map< Ship::StickIndex, std::vector< std::pair< Ship::Direction, Ship::KbScancode > > > defaultKeyboardKeyToAxisDirectionMappings, std::unordered_map< CONTROLLERBUTTONS_T, std::unordered_set< SDL_GamepadButton > > defaultSDLButtonToButtonMappings, std::unordered_map< Ship::StickIndex, std::vector< std::pair< Ship::Direction, SDL_GamepadButton > > > defaultSDLButtonToAxisDirectionMappings, std::unordered_map< CONTROLLERBUTTONS_T, std::vector< std::pair< SDL_GamepadAxis, int32_t > > > defaultSDLAxisDirectionToButtonMappings, std::unordered_map< Ship::StickIndex, std::vector< std::pair< Ship::Direction, std::pair< SDL_GamepadAxis, int32_t > > > > defaultSDLAxisDirectionToAxisDirectionMappings)
Full constructor — supply all default mapping tables explicitly.
ControllerDefaultMappings()
Constructs with an empty mapping table (all defaults are unset).
Holds the default input-to-button and input-to-axis mappings for a controller.
Definition ControllerDefaultMappings.h:25
Definition ControlDeck.h:13
Direction
Identifies the direction component of an axis mapping.
Definition ControllerAxisDirectionMapping.h:18
StickIndex
Identifies which analog stick an axis mapping applies to.
Definition ControllerAxisDirectionMapping.h:15