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

Base class for mappings that bind a mouse button to any controller input. More...

#include <MouseButtonToAnyMapping.h>

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

Public Member Functions

 MouseButtonToAnyMapping (MouseBtn button)
 Constructs a mouse-button mapping for the given button.
 
virtual ~MouseButtonToAnyMapping ()
 Destructor.
 
bool ProcessMouseButtonEvent (bool isPressed, MouseBtn button)
 Processes a mouse button event and updates the internal pressed state.
 
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 mouse button.
 
- 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.
 

Protected Attributes

MouseBtn mButton
 
bool mKeyPressed
 
- Protected Attributes inherited from Ship::ControllerMapping
PhysicalDeviceType mPhysicalDeviceType
 

Detailed Description

Base class for mappings that bind a mouse button to any controller input.

Provides shared mouse-button event processing and physical device/input name reporting. Concrete subclasses add the target input semantics (button or axis direction).

Constructor & Destructor Documentation

◆ MouseButtonToAnyMapping()

Ship::MouseButtonToAnyMapping::MouseButtonToAnyMapping ( MouseBtn  button)

Constructs a mouse-button mapping for the given button.

Parameters
buttonThe mouse button to bind.

◆ ~MouseButtonToAnyMapping()

virtual Ship::MouseButtonToAnyMapping::~MouseButtonToAnyMapping ( )
virtual

Destructor.

Member Function Documentation

◆ GetPhysicalDeviceName()

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

Returns the human-readable name of the mouse device.

Reimplemented from Ship::ControllerMapping.

Reimplemented in Ship::MouseButtonToAxisDirectionMapping, and Ship::MouseButtonToButtonMapping.

◆ GetPhysicalInputName()

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

Returns the human-readable name of the bound mouse button.

Reimplemented from Ship::ControllerInputMapping.

Reimplemented in Ship::MouseButtonToAxisDirectionMapping, and Ship::MouseButtonToButtonMapping.

◆ ProcessMouseButtonEvent()

bool Ship::MouseButtonToAnyMapping::ProcessMouseButtonEvent ( bool  isPressed,
MouseBtn  button 
)

Processes a mouse button event and updates the internal pressed state.

Parameters
isPressedtrue if the button was pressed, false if released.
buttonThe mouse button associated with the event.
Returns
true if this mapping's button was affected by the event.

Member Data Documentation

◆ mButton

MouseBtn Ship::MouseButtonToAnyMapping::mButton
protected

◆ mKeyPressed

bool Ship::MouseButtonToAnyMapping::mKeyPressed
protected

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