|
VR-Engage
2.2
|
This class implements configurable mouse control with focus awareness. It provides functionality to toggle mouse control on/off, handle focus changes, and manage mouse centering. It integrates with the message system to respond to system-wide state changes that affect mouse behavior.
#include <mouseControl.h>
Public Member Functions | |
| DtMouseControl (makVrv::DtDe &de) | |
| virtual | ~DtMouseControl () |
| virtual bool | init () |
| virtual void | shutdown () |
| virtual bool | isEnabled () const |
| virtual bool | isFocused () const |
| virtual void | centerMouse () |
| makVrv::DtChannel * | getChannel () const |
Protected Member Functions | |
| virtual void | updateMouseControlState () |
| virtual DtVreMessageResult | handleToggleMouseControl (DtVreMessage *msg) |
| virtual DtVreMessageResult | handlePlayerControlsState (DtVreMessage *msg) |
| virtual DtVreMessageResult | handleFocusState (DtVreMessage *msg) |
| virtual void | updateChannel (const std::string &windowName="", const std::string &channelName="") |
Protected Attributes | |
| DtMouseControlFocusWatcher | myMouseControlFocusWatcher |
| makVrv::DtDe & | myDe |
| makVrv::DtChannel * | myChannel |
| bool | myEnabled |
| bool | myIsToggledOn |
| bool | myPlayerControlsEnabled |
| bool | myHasFocus |
| makVre::DtMouseControl::DtMouseControl | ( | makVrv::DtDe & | de | ) |
Constructor that initializes mouse control.
Sets up the mouse control system with the given display environment.
| de | Reference to the display environment |
References de().
|
virtual |
Virtual destructor.
Cleans up resources owned by the mouse control system
|
virtual |
Initialize the mouse control system.
Sets up message handlers and initializes the mouse control state.
|
virtual |
Shut down the mouse control system.
Unregisters message handlers and cleans up resources allocated during initialization
|
virtual |
Check if mouse control is currently enabled.
|
virtual |
Check if the application window has focus.
|
virtual |
Center the mouse cursor in the application window.
Positions the mouse cursor at the center of the current viewport
| makVrv::DtChannel * makVre::DtMouseControl::getChannel | ( | ) | const |
Get the current input channel.
Returns the channel used for mouse input events
|
protectedvirtual |
Update the mouse control state based on current system state.
Evaluates focus state, toggle state, and player controls state to determine whether mouse control should be enabled or disabled
|
protectedvirtual |
Handle message to toggle mouse control on or off.
Message handler that toggles the mouse control state when requested
| msg | Pointer to the toggle mouse control message |
|
protectedvirtual |
Handle message indicating player controls state change.
Message handler that updates mouse control in response to player controls state changes
| msg | Pointer to the player controls state message |
|
protectedvirtual |
Handle message indicating focus state change.
Message handler that updates mouse control in response to window focus changes
| msg | Pointer to the focus state message |
|
protectedvirtual |
Update the input channel for mouse events.
Sets or updates the channel used for mouse input events based on window and channel names
| windowName | Name of the window to associate with the channel |
| channelName | Name of the channel to use |
|
protected |
Focus watcher for detecting window focus changes.
|
protected |
Reference to the display environment.
|
protected |
Pointer to the current input channel.
|
protected |
Flag indicating if mouse control is currently enabled.
|
protected |
Flag indicating if mouse control is toggled on by the user.
When true, mouse control should be enabled if system state allows it
|
protected |
Flag indicating if player controls are enabled.
|
protected |
Flag indicating if application has focus.