|
libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
|
Maps an SDL gamepad button to a virtual controller button. More...
#include <SDLButtonToButtonMapping.h>
Public Member Functions | |
| SDLButtonToButtonMapping (uint8_t portIndex, CONTROLLERBUTTONS_T bitmask, int32_t sdlControllerButton, std::shared_ptr< ControlDeck > controlDeck=nullptr, std::shared_ptr< ConsoleVariable > consoleVariable=nullptr) | |
| Constructs an SDL button-to-button mapping. | |
| void | UpdatePad (CONTROLLERBUTTONS_T &padButtons) override |
| Updates the pad button state based on the current gamepad button state. | |
| int8_t | GetMappingType () override |
| Returns the mapping type identifier. | |
| std::string | GetButtonMappingId () override |
| Returns the unique string identifier for this mapping. | |
| void | SaveToConfig () override |
| Persists this mapping to the application configuration. | |
| void | EraseFromConfig () override |
| Removes this mapping from the application configuration. | |
| std::string | GetPhysicalDeviceName () override |
| Returns the human-readable name of the SDL gamepad device. | |
| std::string | GetPhysicalInputName () override |
| Returns the human-readable name of the bound button. | |
Public Member Functions inherited from Ship::SDLButtonToAnyMapping | |
| SDLButtonToAnyMapping (int32_t sdlControllerButton) | |
| Constructs an SDL button mapping. | |
| virtual | ~SDLButtonToAnyMapping () |
| Destructor. | |
Public Member Functions inherited from Ship::ControllerInputMapping | |
| ControllerInputMapping (PhysicalDeviceType physicalDeviceType) | |
| Constructs a ControllerInputMapping for the given physical device type. | |
| ~ControllerInputMapping () | |
Public Member Functions inherited from Ship::ControllerMapping | |
| ControllerMapping (PhysicalDeviceType physicalDeviceType) | |
| Constructs a ControllerMapping for the given physical device type. | |
| ~ControllerMapping () | |
| PhysicalDeviceType | GetPhysicalDeviceType () |
| Returns the physical device type for this mapping. | |
Public Member Functions inherited from Ship::ControllerButtonMapping | |
| ControllerButtonMapping (PhysicalDeviceType physicalDeviceType, uint8_t portIndex, CONTROLLERBUTTONS_T bitmask, std::shared_ptr< ControlDeck > controlDeck=nullptr) | |
| Constructs a ControllerButtonMapping. | |
| virtual | ~ControllerButtonMapping () |
| CONTROLLERBUTTONS_T | GetBitmask () |
| Returns the button bitmask this mapping is bound to. | |
| void | SetPortIndex (uint8_t portIndex) |
| Sets the controller port index for this mapping. | |
| std::shared_ptr< ControlDeck > | GetControlDeck () const |
Protected Attributes | |
| std::shared_ptr< ConsoleVariable > | mConsoleVariable |
| std::shared_ptr< ControlDeck > | mControlDeck |
Protected Attributes inherited from Ship::SDLButtonToAnyMapping | |
| SDL_GameControllerButton | mControllerButton |
Protected Attributes inherited from Ship::ControllerMapping | |
| PhysicalDeviceType | mPhysicalDeviceType |
Protected Attributes inherited from Ship::ControllerButtonMapping | |
| uint8_t | mPortIndex |
| CONTROLLERBUTTONS_T | mBitmask |
| std::shared_ptr< ControlDeck > | mControlDeck |
Maps an SDL gamepad button to a virtual controller button.
When the bound gamepad button is held the corresponding button bitmask bit is set in the pad state; when released the bit is cleared.
| Ship::SDLButtonToButtonMapping::SDLButtonToButtonMapping | ( | uint8_t | portIndex, |
| CONTROLLERBUTTONS_T | bitmask, | ||
| int32_t | sdlControllerButton, | ||
| std::shared_ptr< ControlDeck > | controlDeck = nullptr, |
||
| std::shared_ptr< ConsoleVariable > | consoleVariable = nullptr |
||
| ) |
Constructs an SDL button-to-button mapping.
| portIndex | The controller port index. |
| bitmask | The button bitmask to set when the gamepad button is held. |
| sdlControllerButton | The SDL controller button index. |
|
overridevirtual |
Removes this mapping from the application configuration.
Implements Ship::ControllerButtonMapping.
|
overridevirtual |
Returns the unique string identifier for this mapping.
Implements Ship::ControllerButtonMapping.
|
overridevirtual |
Returns the mapping type identifier.
Reimplemented from Ship::ControllerButtonMapping.
|
overridevirtual |
Returns the human-readable name of the SDL gamepad device.
Reimplemented from Ship::SDLButtonToAnyMapping.
|
overridevirtual |
Returns the human-readable name of the bound button.
Reimplemented from Ship::SDLButtonToAnyMapping.
|
overridevirtual |
Persists this mapping to the application configuration.
Implements Ship::ControllerButtonMapping.
|
overridevirtual |
Updates the pad button state based on the current gamepad button state.
| padButtons | Reference to the button bitfield to update. |
Implements Ship::ControllerButtonMapping.
|
protected |
|
protected |