This class bridges the gap between the core event system and the input system by implementing both DtInputDevice and DtEventProcessorInterface. It receives keyboard and mouse events from the core system and translates them into DtInputData structures that can be processed by the input manager.
#include <vrvKeyboardMouseDevice.h>
◆ DtVrvKeyboardMouseDevice()
| makVre::DtVrvKeyboardMouseDevice::DtVrvKeyboardMouseDevice |
( |
| ) |
|
Default constructor.
Initializes the event processor and sets up default values
◆ ~DtVrvKeyboardMouseDevice()
| virtual makVre::DtVrvKeyboardMouseDevice::~DtVrvKeyboardMouseDevice |
( |
| ) |
|
|
overridevirtual |
Virtual destructor.
Cleans up resources owned by the event processor
◆ init()
Initializes the event processor.
Sets up the event processor with the input manager and initializes mouse control and event handling structures. Registers message handlers.
- Parameters
-
| mgr | Reference to the input manager that owns this device |
- Returns
- True if initialization succeeded, false otherwise
Implements makVre::DtInputDevice.
◆ shutdown()
| virtual void makVre::DtVrvKeyboardMouseDevice::shutdown |
( |
| ) |
|
|
overridevirtual |
Shuts down the event processor.
Unregisters message handlers and cleans up resources allocated during initialization
Implements makVre::DtInputDevice.
◆ reportCurrentState()
| virtual void makVre::DtVrvKeyboardMouseDevice::reportCurrentState |
( |
| ) |
|
|
inlineoverridevirtual |
Reports the current state of input device controls.
Empty implementation as there's no persistent state to report for keyboard/mouse
Implements makVre::DtInputDevice.
◆ tick()
| virtual void makVre::DtVrvKeyboardMouseDevice::tick |
( |
double | dt | ) |
|
|
overridevirtual |
Updates the event processor for the current frame.
Handles time-based updates including mouse movement processing
- Parameters
-
| dt | Delta time in seconds since the last frame |
Implements makVre::DtInputDevice.
◆ processKeyboardEvent()
| virtual bool makVre::DtVrvKeyboardMouseDevice::processKeyboardEvent |
( |
const makVrv::DtKeyEvent & | ev, |
|
|
makVrv::DtChannel & | channel ) |
|
overridevirtual |
Processes keyboard events from the core system.
Translates core keyboard events into input data structures and forwards them to the input manager for processing.
- Parameters
-
| ev | The keyboard event to process |
| channel | The channel from which the event originated |
- Returns
- True if the event was handled, false otherwise
◆ processMouseEvent()
| virtual bool makVre::DtVrvKeyboardMouseDevice::processMouseEvent |
( |
const makVrv::DtMouseEvent & | ev, |
|
|
makVrv::DtChannel & | channel ) |
|
overridevirtual |
Processes mouse events from the core system.
Translates core mouse events (clicks, scrolls) into input data structures and forwards them to the input manager for processing.
- Parameters
-
| ev | The mouse event to process |
| channel | The channel from which the event originated |
- Returns
- True if the event was handled, false otherwise
◆ processMouseMove()
| virtual void makVre::DtVrvKeyboardMouseDevice::processMouseMove |
( |
float | x, |
|
|
float | y ) |
|
virtual |
Processes mouse movement events.
Handles mouse movement and converts it into input data for the input manager. This is called separately from processMouseEvent for continuous mouse movement.
- Parameters
-
| x | The x-coordinate of the mouse cursor |
| y | The y-coordinate of the mouse cursor |
◆ className()
| virtual const std::string & makVre::DtVrvKeyboardMouseDevice::className |
( |
| ) |
|
|
overridevirtual |
Gets the class name of this event processor.
Implements the DtEventProcessorInterface requirement to provide a class name.
- Returns
- Reference to a string containing the class name
◆ handleSetVRVInputEnabled()
Handles messages to enable or disable VRV input processing.
Message handler that toggles whether VRV input events are processed
- Parameters
-
| msg | Pointer to the message to handle |
- Returns
- Result indicating whether the message was handled
◆ setMouseClickData()
| virtual void makVre::DtVrvKeyboardMouseDevice::setMouseClickData |
( |
DtMouseButton | button, |
|
|
bool | doubleClick, |
|
|
bool | raised ) |
|
protectedvirtual |
Sets up mouse click input data.
Helper method to populate mouse input data structure for button clicks
- Parameters
-
| button | The mouse button that was clicked |
| doubleClick | Whether this is a double-click event |
| raised | Whether the button was raised (released) or pressed |
◆ myClassName
| std::string makVre::DtVrvKeyboardMouseDevice::myClassName |
|
protected |
Class name for identification in the event system.
◆ myManager
Pointer to the input manager that owns this device.
◆ myVRVInputEnabled
| bool makVre::DtVrvKeyboardMouseDevice::myVRVInputEnabled |
|
protected |
Flag indicating whether VRV input processing is enabled.
◆ myMouseInputData
| DtInputData makVre::DtVrvKeyboardMouseDevice::myMouseInputData |
|
protected |
Reusable structure for mouse input data.
◆ myKeyboardInputData
| DtInputData makVre::DtVrvKeyboardMouseDevice::myKeyboardInputData |
|
protected |
Reusable structure for keyboard input data.
◆ myMouseControl
| std::unique_ptr<DtMouseControl> makVre::DtVrvKeyboardMouseDevice::myMouseControl |
|
protected |
Mouse control object for handling mouse behavior.
◆ myLastMouseMoveUpdate
| double makVre::DtVrvKeyboardMouseDevice::myLastMouseMoveUpdate |
|
protected |
Timestamp of the last mouse move update.
◆ myMouseDoubleClickState
| std::vector<bool> makVre::DtVrvKeyboardMouseDevice::myMouseDoubleClickState {false, false, false} |
|
protected |
Tracking state for double-click detection (one entry per button)
The documentation for this class was generated from the following file: