|
libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
|
Maps a physical input to a virtual controller button. More...
#include <ControllerButtonMapping.h>
Public Member Functions | |
| ControllerButtonMapping (PhysicalDeviceType physicalDeviceType, uint8_t portIndex, CONTROLLERBUTTONS_T bitmask, std::shared_ptr< ControlDeck > controlDeck=nullptr) | |
| Constructs a ControllerButtonMapping. | |
| virtual | ~ControllerButtonMapping () |
| virtual std::string | GetButtonMappingId ()=0 |
| Returns a unique string identifier for this button mapping. | |
| CONTROLLERBUTTONS_T | GetBitmask () |
| Returns the button bitmask this mapping is bound to. | |
| virtual void | UpdatePad (CONTROLLERBUTTONS_T &padButtons)=0 |
| Reads the physical input state and sets the corresponding bits in padButtons. | |
| virtual int8_t | GetMappingType () |
| Returns the mapping type identifier (e.g. gamepad, keyboard). | |
| void | SetPortIndex (uint8_t portIndex) |
| Sets the controller port index for this mapping. | |
| std::shared_ptr< ControlDeck > | GetControlDeck () const |
| virtual void | SaveToConfig ()=0 |
| Persists this mapping to the application configuration. | |
| virtual void | EraseFromConfig ()=0 |
| Removes this mapping from the application configuration. | |
Public Member Functions inherited from Ship::ControllerInputMapping | |
| ControllerInputMapping (PhysicalDeviceType physicalDeviceType) | |
| Constructs a ControllerInputMapping for the given physical device type. | |
| ~ControllerInputMapping () | |
| virtual std::string | GetPhysicalInputName () |
| Returns a human-readable name for the physical input this mapping represents. | |
Public Member Functions inherited from Ship::ControllerMapping | |
| ControllerMapping (PhysicalDeviceType physicalDeviceType) | |
| Constructs a ControllerMapping for the given physical device type. | |
| ~ControllerMapping () | |
| virtual std::string | GetPhysicalDeviceName () |
| Returns a human-readable name for the physical device associated with this mapping. | |
| PhysicalDeviceType | GetPhysicalDeviceType () |
| Returns the physical device type for this mapping. | |
Protected Attributes | |
| uint8_t | mPortIndex |
| CONTROLLERBUTTONS_T | mBitmask |
| std::shared_ptr< ControlDeck > | mControlDeck |
Protected Attributes inherited from Ship::ControllerMapping | |
| PhysicalDeviceType | mPhysicalDeviceType |
Maps a physical input to a virtual controller button.
Subclasses implement the details for specific device types (keyboard keys, SDL gamepad buttons/axes, etc.) and set the corresponding button bits when the physical input is active.
| Ship::ControllerButtonMapping::ControllerButtonMapping | ( | PhysicalDeviceType | physicalDeviceType, |
| uint8_t | portIndex, | ||
| CONTROLLERBUTTONS_T | bitmask, | ||
| std::shared_ptr< ControlDeck > | controlDeck = nullptr |
||
| ) |
Constructs a ControllerButtonMapping.
| physicalDeviceType | The type of physical device this mapping targets. |
| portIndex | The controller port index this mapping is assigned to. |
| bitmask | The button bitmask this mapping controls. |
|
virtual |
|
pure virtual |
Removes this mapping from the application configuration.
Implemented in Ship::KeyboardKeyToButtonMapping, Ship::MouseButtonToButtonMapping, Ship::MouseWheelToButtonMapping, Ship::SDLAxisDirectionToButtonMapping, and Ship::SDLButtonToButtonMapping.
| CONTROLLERBUTTONS_T Ship::ControllerButtonMapping::GetBitmask | ( | ) |
Returns the button bitmask this mapping is bound to.
|
pure virtual |
Returns a unique string identifier for this button mapping.
Implemented in Ship::KeyboardKeyToButtonMapping, Ship::MouseButtonToButtonMapping, Ship::MouseWheelToButtonMapping, Ship::SDLAxisDirectionToButtonMapping, and Ship::SDLButtonToButtonMapping.
| std::shared_ptr< ControlDeck > Ship::ControllerButtonMapping::GetControlDeck | ( | ) | const |
|
virtual |
Returns the mapping type identifier (e.g. gamepad, keyboard).
Reimplemented in Ship::KeyboardKeyToButtonMapping, Ship::MouseButtonToButtonMapping, Ship::MouseWheelToButtonMapping, Ship::SDLAxisDirectionToButtonMapping, and Ship::SDLButtonToButtonMapping.
|
pure virtual |
Persists this mapping to the application configuration.
Implemented in Ship::KeyboardKeyToButtonMapping, Ship::MouseButtonToButtonMapping, Ship::MouseWheelToButtonMapping, Ship::SDLAxisDirectionToButtonMapping, and Ship::SDLButtonToButtonMapping.
| void Ship::ControllerButtonMapping::SetPortIndex | ( | uint8_t | portIndex | ) |
Sets the controller port index for this mapping.
| portIndex | The new port index. |
|
pure virtual |
Reads the physical input state and sets the corresponding bits in padButtons.
| padButtons | Reference to the button state bitfield to update. |
Implemented in Ship::KeyboardKeyToButtonMapping, Ship::MouseButtonToButtonMapping, Ship::MouseWheelToButtonMapping, Ship::SDLAxisDirectionToButtonMapping, and Ship::SDLButtonToButtonMapping.
|
protected |
|
protected |
|
protected |