libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
Loading...
Searching...
No Matches
SDLAxisDirectionToButtonMapping.h
Go to the documentation of this file.
3#include <memory>
4
5namespace Ship {
6class ConsoleVariable;
7class ControlDeck;
8
16 public:
24 SDLAxisDirectionToButtonMapping(uint8_t portIndex, CONTROLLERBUTTONS_T bitmask, int32_t sdlControllerAxis,
25 int32_t axisDirection, std::shared_ptr<ControlDeck> controlDeck = nullptr,
26 std::shared_ptr<ConsoleVariable> consoleVariable = nullptr);
27
32 void UpdatePad(CONTROLLERBUTTONS_T& padButtons) override;
33
35 int8_t GetMappingType() override;
36
38 std::string GetButtonMappingId() override;
39
41 void SaveToConfig() override;
42
44 void EraseFromConfig() override;
45
47 std::string GetPhysicalDeviceName() override;
48
50 std::string GetPhysicalInputName() override;
51
52 protected:
53 std::shared_ptr<ConsoleVariable> mConsoleVariable;
54 std::shared_ptr<ControlDeck> mControlDeck;
55};
56} // namespace Ship
#define CONTROLLERBUTTONS_T
Definition ControllerButtonMapping.h:13
Maps a physical input to a virtual controller button.
Definition ControllerButtonMapping.h:23
Base class for mappings that bind an SDL gamepad axis direction to any controller input.
Definition SDLAxisDirectionToAnyMapping.h:14
Maps an SDL gamepad axis direction to a virtual controller button.
Definition SDLAxisDirectionToButtonMapping.h:15
std::string GetPhysicalDeviceName() override
Returns the human-readable name of the SDL gamepad device.
SDLAxisDirectionToButtonMapping(uint8_t portIndex, CONTROLLERBUTTONS_T bitmask, int32_t sdlControllerAxis, int32_t axisDirection, std::shared_ptr< ControlDeck > controlDeck=nullptr, std::shared_ptr< ConsoleVariable > consoleVariable=nullptr)
Constructs an SDL axis-direction-to-button mapping.
void EraseFromConfig() override
Removes this mapping from the application configuration.
void SaveToConfig() override
Persists this mapping to the application configuration.
void UpdatePad(CONTROLLERBUTTONS_T &padButtons) override
Updates the pad button state based on the current axis value.
std::string GetPhysicalInputName() override
Returns the human-readable name of the bound axis and direction.
int8_t GetMappingType() override
Returns the mapping type identifier.
std::shared_ptr< ControlDeck > mControlDeck
Definition SDLAxisDirectionToButtonMapping.h:54
std::shared_ptr< ConsoleVariable > mConsoleVariable
Definition SDLAxisDirectionToButtonMapping.h:53
std::string GetButtonMappingId() override
Returns the unique string identifier for this mapping.
Core namespace for the libultraship engine framework.
Definition gfx_direct3d_common.h:14