libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
Loading...
Searching...
No Matches
Ship::MouseWheelToButtonMapping Class Referencefinal

Maps a mouse scroll-wheel direction to a virtual controller button. More...

#include <MouseWheelToButtonMapping.h>

Inheritance diagram for Ship::MouseWheelToButtonMapping:
[legend]
Collaboration diagram for Ship::MouseWheelToButtonMapping:
[legend]

Public Member Functions

 MouseWheelToButtonMapping (uint8_t portIndex, CONTROLLERBUTTONS_T bitmask, WheelDirection wheelDirection, std::shared_ptr< ControlDeck > controlDeck=nullptr, std::shared_ptr< ConsoleVariable > consoleVariable=nullptr)
 Constructs a mouse-wheel-to-button mapping.
 
void UpdatePad (CONTROLLERBUTTONS_T &padButtons) override
 Updates the pad button state based on the current wheel 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 mouse device.
 
std::string GetPhysicalInputName () override
 Returns the human-readable name of the bound wheel direction.
 
- Public Member Functions inherited from Ship::MouseWheelToAnyMapping
 MouseWheelToAnyMapping (WheelDirection wheelDirection)
 Constructs a mouse-wheel mapping for the given scroll direction.
 
virtual ~MouseWheelToAnyMapping ()
 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< ControlDeckGetControlDeck () const
 

Protected Attributes

std::shared_ptr< ConsoleVariablemConsoleVariable
 
std::shared_ptr< ControlDeckmControlDeck
 
- Protected Attributes inherited from Ship::MouseWheelToAnyMapping
WheelDirection mWheelDirection
 
- Protected Attributes inherited from Ship::ControllerMapping
PhysicalDeviceType mPhysicalDeviceType
 
- Protected Attributes inherited from Ship::ControllerButtonMapping
uint8_t mPortIndex
 
CONTROLLERBUTTONS_T mBitmask
 
std::shared_ptr< ControlDeckmControlDeck
 

Detailed Description

Maps a mouse scroll-wheel direction to a virtual controller button.

Scrolling in the bound direction sets the corresponding button bitmask bit in the pad state; when scrolling stops the bit is cleared.

Constructor & Destructor Documentation

◆ MouseWheelToButtonMapping()

Ship::MouseWheelToButtonMapping::MouseWheelToButtonMapping ( uint8_t  portIndex,
CONTROLLERBUTTONS_T  bitmask,
WheelDirection  wheelDirection,
std::shared_ptr< ControlDeck controlDeck = nullptr,
std::shared_ptr< ConsoleVariable consoleVariable = nullptr 
)

Constructs a mouse-wheel-to-button mapping.

Parameters
portIndexThe controller port index.
bitmaskThe button bitmask to set when the wheel is scrolled.
wheelDirectionThe scroll-wheel direction to bind.

Member Function Documentation

◆ EraseFromConfig()

void Ship::MouseWheelToButtonMapping::EraseFromConfig ( )
overridevirtual

Removes this mapping from the application configuration.

Implements Ship::ControllerButtonMapping.

◆ GetButtonMappingId()

std::string Ship::MouseWheelToButtonMapping::GetButtonMappingId ( )
overridevirtual

Returns the unique string identifier for this mapping.

Implements Ship::ControllerButtonMapping.

◆ GetMappingType()

int8_t Ship::MouseWheelToButtonMapping::GetMappingType ( )
overridevirtual

Returns the mapping type identifier.

Reimplemented from Ship::ControllerButtonMapping.

◆ GetPhysicalDeviceName()

std::string Ship::MouseWheelToButtonMapping::GetPhysicalDeviceName ( )
overridevirtual

Returns the human-readable name of the mouse device.

Reimplemented from Ship::MouseWheelToAnyMapping.

◆ GetPhysicalInputName()

std::string Ship::MouseWheelToButtonMapping::GetPhysicalInputName ( )
overridevirtual

Returns the human-readable name of the bound wheel direction.

Reimplemented from Ship::MouseWheelToAnyMapping.

◆ SaveToConfig()

void Ship::MouseWheelToButtonMapping::SaveToConfig ( )
overridevirtual

Persists this mapping to the application configuration.

Implements Ship::ControllerButtonMapping.

◆ UpdatePad()

void Ship::MouseWheelToButtonMapping::UpdatePad ( CONTROLLERBUTTONS_T padButtons)
overridevirtual

Updates the pad button state based on the current wheel state.

Parameters
padButtonsReference to the button bitfield to update.

Implements Ship::ControllerButtonMapping.

Member Data Documentation

◆ mConsoleVariable

std::shared_ptr<ConsoleVariable> Ship::MouseWheelToButtonMapping::mConsoleVariable
protected

◆ mControlDeck

std::shared_ptr<ControlDeck> Ship::MouseWheelToButtonMapping::mControlDeck
protected

The documentation for this class was generated from the following file: