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_GameControllerButton>>
36 defaultSDLButtonToButtonMappings,
37 std::unordered_map<Ship::StickIndex, std::vector<std::pair<Ship::Direction, SDL_GameControllerButton>>>
38 defaultSDLButtonToAxisDirectionMappings,
39 std::unordered_map<CONTROLLERBUTTONS_T, std::vector<std::pair<SDL_GameControllerAxis, int32_t>>>
40 defaultSDLAxisDirectionToButtonMappings,
41 std::unordered_map<Ship::StickIndex,
42 std::vector<std::pair<Ship::Direction, std::pair<SDL_GameControllerAxis, int32_t>>>>
43 defaultSDLAxisDirectionToAxisDirectionMappings);
44
52
53 private:
58 void
59 SetDefaultKeyboardKeyToButtonMappings(std::unordered_map<CONTROLLERBUTTONS_T, std::unordered_set<Ship::KbScancode>>
60 defaultKeyboardKeyToButtonMappings) override;
61
66 void SetDefaultSDLButtonToButtonMappings(
67 std::unordered_map<CONTROLLERBUTTONS_T, std::unordered_set<SDL_GameControllerButton>>
68 defaultSDLButtonToButtonMappings) override;
69
74 void SetDefaultSDLAxisDirectionToButtonMappings(
75 std::unordered_map<CONTROLLERBUTTONS_T, std::vector<std::pair<SDL_GameControllerAxis, int32_t>>>
76 defaultSDLAxisDirectionToButtonMappings) override;
77};
78} // 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_GameControllerButton > > defaultSDLButtonToButtonMappings, std::unordered_map< Ship::StickIndex, std::vector< std::pair< Ship::Direction, SDL_GameControllerButton > > > defaultSDLButtonToAxisDirectionMappings, std::unordered_map< CONTROLLERBUTTONS_T, std::vector< std::pair< SDL_GameControllerAxis, int32_t > > > defaultSDLAxisDirectionToButtonMappings, std::unordered_map< Ship::StickIndex, std::vector< std::pair< Ship::Direction, std::pair< SDL_GameControllerAxis, 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