|
libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
|
N64-specific controller default mapping configuration. More...
#include <ControllerDefaultMappings.h>
Public Member Functions | |
| 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). | |
| ~ControllerDefaultMappings () | |
Public Member Functions inherited from Ship::ControllerDefaultMappings | |
| ControllerDefaultMappings (std::unordered_map< CONTROLLERBUTTONS_T, std::unordered_set< KbScancode > > defaultKeyboardKeyToButtonMappings, std::unordered_map< StickIndex, std::vector< std::pair< Direction, KbScancode > > > defaultKeyboardKeyToAxisDirectionMappings, std::unordered_map< CONTROLLERBUTTONS_T, std::unordered_set< SDL_GameControllerButton > > defaultSDLButtonToButtonMappings, std::unordered_map< StickIndex, std::vector< std::pair< Direction, SDL_GameControllerButton > > > defaultSDLButtonToAxisDirectionMappings, std::unordered_map< CONTROLLERBUTTONS_T, std::vector< std::pair< SDL_GameControllerAxis, int32_t > > > defaultSDLAxisDirectionToButtonMappings, std::unordered_map< StickIndex, std::vector< std::pair< Direction, std::pair< SDL_GameControllerAxis, int32_t > > > > defaultSDLAxisDirectionToAxisDirectionMappings) | |
| Constructs a ControllerDefaultMappings with fully specified default tables. | |
| ControllerDefaultMappings () | |
| Constructs a ControllerDefaultMappings with empty default tables. | |
| ~ControllerDefaultMappings () | |
| std::unordered_map< CONTROLLERBUTTONS_T, std::unordered_set< KbScancode > > | GetDefaultKeyboardKeyToButtonMappings () |
| Returns the default keyboard-key-to-button mappings. | |
| std::unordered_map< StickIndex, std::vector< std::pair< Direction, KbScancode > > > | GetDefaultKeyboardKeyToAxisDirectionMappings () |
| Returns the default keyboard-key-to-axis-direction mappings. | |
| std::unordered_map< CONTROLLERBUTTONS_T, std::unordered_set< SDL_GameControllerButton > > | GetDefaultSDLButtonToButtonMappings () |
| Returns the default SDL-button-to-button mappings. | |
| std::unordered_map< StickIndex, std::vector< std::pair< Direction, SDL_GameControllerButton > > > | GetDefaultSDLButtonToAxisDirectionMappings () |
| Returns the default SDL-button-to-axis-direction mappings. | |
| std::unordered_map< CONTROLLERBUTTONS_T, std::vector< std::pair< SDL_GameControllerAxis, int32_t > > > | GetDefaultSDLAxisDirectionToButtonMappings () |
| Returns the default SDL-axis-direction-to-button mappings. | |
| std::unordered_map< StickIndex, std::vector< std::pair< Direction, std::pair< SDL_GameControllerAxis, int32_t > > > > | GetDefaultSDLAxisDirectionToAxisDirectionMappings () |
| Returns the default SDL-axis-direction-to-axis-direction mappings. | |
Additional Inherited Members | |
Protected Member Functions inherited from Ship::ControllerDefaultMappings | |
| virtual void | SetDefaultKeyboardKeyToAxisDirectionMappings (std::unordered_map< StickIndex, std::vector< std::pair< Direction, KbScancode > > > defaultKeyboardKeyToAxisDirectionMappings) |
| Replaces the default keyboard-key-to-axis-direction mappings. | |
| virtual void | SetDefaultSDLButtonToAxisDirectionMappings (std::unordered_map< StickIndex, std::vector< std::pair< Direction, SDL_GameControllerButton > > > defaultSDLButtonToAxisDirectionMappings) |
| Replaces the default SDL-button-to-axis-direction mappings. | |
| virtual void | SetDefaultSDLAxisDirectionToAxisDirectionMappings (std::unordered_map< StickIndex, std::vector< std::pair< Direction, std::pair< SDL_GameControllerAxis, int32_t > > > > defaultSDLAxisDirectionToAxisDirectionMappings) |
| Replaces the default SDL-axis-direction-to-axis-direction mappings. | |
N64-specific controller default mapping configuration.
LUS::ControllerDefaultMappings is the concrete ControllerDefaultMappings subclass used by libultraship. It provides the standard N64 button layout for keyboard, SDL gamepad buttons, and SDL axis-to-button mappings so that newly connected devices receive sensible default bindings out of the box.
Pass an instance to LUS::ControlDeck (or Ship::ControlDeck) to customise the default mappings applied when a new physical device is detected.
| LUS::ControllerDefaultMappings::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.
| defaultKeyboardKeyToButtonMappings | Button → keyboard key default bindings. |
| defaultKeyboardKeyToAxisDirectionMappings | Stick direction → keyboard key default bindings. |
| defaultSDLButtonToButtonMappings | Button → SDL gamepad button default bindings. |
| defaultSDLButtonToAxisDirectionMappings | Stick direction → SDL button default bindings. |
| defaultSDLAxisDirectionToButtonMappings | Button → SDL axis default bindings. |
| defaultSDLAxisDirectionToAxisDirectionMappings | Stick direction → SDL axis default bindings. |
| LUS::ControllerDefaultMappings::ControllerDefaultMappings | ( | ) |
Constructs with an empty mapping table (all defaults are unset).
Use this when you want to build defaults incrementally via the base-class setters.
| LUS::ControllerDefaultMappings::~ControllerDefaultMappings | ( | ) |