libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
Loading...
Searching...
No Matches
KeyboardKeyToButtonMapping.h
Go to the documentation of this file.
3#include <memory>
4
5namespace Ship {
6class ConsoleVariable;
7class ControlDeck;
8
16 public:
23 KeyboardKeyToButtonMapping(uint8_t portIndex, CONTROLLERBUTTONS_T bitmask, KbScancode scancode,
24 std::shared_ptr<ControlDeck> controlDeck = nullptr,
25 std::shared_ptr<Window> window = 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 a keyboard key to any controller input.
Definition KeyboardKeyToAnyMapping.h:17
Maps a keyboard key to a virtual controller button.
Definition KeyboardKeyToButtonMapping.h:15
std::string GetPhysicalDeviceName() override
Returns the human-readable name of the keyboard device.
std::string GetPhysicalInputName() override
Returns the human-readable name of the bound key.
std::shared_ptr< ControlDeck > mControlDeck
Definition KeyboardKeyToButtonMapping.h:54
void EraseFromConfig() override
Removes this mapping from the application configuration.
std::string GetButtonMappingId() override
Returns the unique string identifier for this mapping.
KeyboardKeyToButtonMapping(uint8_t portIndex, CONTROLLERBUTTONS_T bitmask, KbScancode scancode, std::shared_ptr< ControlDeck > controlDeck=nullptr, std::shared_ptr< Window > window=nullptr, std::shared_ptr< ConsoleVariable > consoleVariable=nullptr)
Constructs a keyboard-key-to-button mapping.
int8_t GetMappingType() override
Returns the mapping type identifier.
void UpdatePad(CONTROLLERBUTTONS_T &padButtons) override
Updates the pad button state based on the current key state.
void SaveToConfig() override
Persists this mapping to the application configuration.
std::shared_ptr< ConsoleVariable > mConsoleVariable
Definition KeyboardKeyToButtonMapping.h:53
Core namespace for the libultraship engine framework.
Definition gfx_direct3d_common.h:14
KbScancode
Platform-independent keyboard scan codes used by the input mapping system.
Definition KeyboardScancodes.h:26