|
libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
|
Holds the default input-to-button and input-to-axis mappings for a controller. More...
#include <ControllerDefaultMappings.h>
Public Member Functions | |
| 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. | |
Protected Member Functions | |
| virtual void | SetDefaultKeyboardKeyToButtonMappings (std::unordered_map< CONTROLLERBUTTONS_T, std::unordered_set< KbScancode > > defaultKeyboardKeyToButtonMappings) |
| Replaces the default keyboard-key-to-button mappings. | |
| 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 | SetDefaultSDLButtonToButtonMappings (std::unordered_map< CONTROLLERBUTTONS_T, std::unordered_set< SDL_GameControllerButton > > defaultSDLButtonToButtonMappings) |
| Replaces the default SDL-button-to-button 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 | SetDefaultSDLAxisDirectionToButtonMappings (std::unordered_map< CONTROLLERBUTTONS_T, std::vector< std::pair< SDL_GameControllerAxis, int32_t > > > defaultSDLAxisDirectionToButtonMappings) |
| Replaces the default SDL-axis-direction-to-button 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. | |
Holds the default input-to-button and input-to-axis mappings for a controller.
Provides separate mapping tables for keyboard-key, SDL-gamepad-button, and SDL-gamepad-axis input sources. Subclasses may override the protected setters to customise the defaults for a specific game or controller layout.
| 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.
| defaultKeyboardKeyToButtonMappings | Keyboard key to button bitmask mappings. |
| defaultKeyboardKeyToAxisDirectionMappings | Keyboard key to axis direction mappings. |
| defaultSDLButtonToButtonMappings | SDL gamepad button to button bitmask mappings. |
| defaultSDLButtonToAxisDirectionMappings | SDL gamepad button to axis direction mappings. |
| defaultSDLAxisDirectionToButtonMappings | SDL gamepad axis direction to button bitmask mappings. |
| defaultSDLAxisDirectionToAxisDirectionMappings | SDL gamepad axis direction to axis direction mappings. |
| Ship::ControllerDefaultMappings::ControllerDefaultMappings | ( | ) |
Constructs a ControllerDefaultMappings with empty default tables.
| Ship::ControllerDefaultMappings::~ControllerDefaultMappings | ( | ) |
| std::unordered_map< StickIndex, std::vector< std::pair< Direction, KbScancode > > > Ship::ControllerDefaultMappings::GetDefaultKeyboardKeyToAxisDirectionMappings | ( | ) |
Returns the default keyboard-key-to-axis-direction mappings.
| std::unordered_map< CONTROLLERBUTTONS_T, std::unordered_set< KbScancode > > Ship::ControllerDefaultMappings::GetDefaultKeyboardKeyToButtonMappings | ( | ) |
Returns the default keyboard-key-to-button mappings.
| std::unordered_map< StickIndex, std::vector< std::pair< Direction, std::pair< SDL_GameControllerAxis, int32_t > > > > Ship::ControllerDefaultMappings::GetDefaultSDLAxisDirectionToAxisDirectionMappings | ( | ) |
Returns the default SDL-axis-direction-to-axis-direction mappings.
| std::unordered_map< CONTROLLERBUTTONS_T, std::vector< std::pair< SDL_GameControllerAxis, int32_t > > > Ship::ControllerDefaultMappings::GetDefaultSDLAxisDirectionToButtonMappings | ( | ) |
Returns the default SDL-axis-direction-to-button mappings.
| std::unordered_map< StickIndex, std::vector< std::pair< Direction, SDL_GameControllerButton > > > Ship::ControllerDefaultMappings::GetDefaultSDLButtonToAxisDirectionMappings | ( | ) |
Returns the default SDL-button-to-axis-direction mappings.
| std::unordered_map< CONTROLLERBUTTONS_T, std::unordered_set< SDL_GameControllerButton > > Ship::ControllerDefaultMappings::GetDefaultSDLButtonToButtonMappings | ( | ) |
Returns the default SDL-button-to-button mappings.
|
protectedvirtual |
Replaces the default keyboard-key-to-axis-direction mappings.
| defaultKeyboardKeyToAxisDirectionMappings | The new mappings. |
|
protectedvirtual |
Replaces the default keyboard-key-to-button mappings.
| defaultKeyboardKeyToButtonMappings | The new mappings. |
|
protectedvirtual |
Replaces the default SDL-axis-direction-to-axis-direction mappings.
| defaultSDLAxisDirectionToAxisDirectionMappings | The new mappings. |
|
protectedvirtual |
Replaces the default SDL-axis-direction-to-button mappings.
| defaultSDLAxisDirectionToButtonMappings | The new mappings. |
|
protectedvirtual |
Replaces the default SDL-button-to-axis-direction mappings.
| defaultSDLButtonToAxisDirectionMappings | The new mappings. |
|
protectedvirtual |
Replaces the default SDL-button-to-button mappings.
| defaultSDLButtonToButtonMappings | The new mappings. |