ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

The Virtual Mouse can produce mouse move events on systems without a physical mouse. More...

#include <virtual-mouse.h>

Inheritance diagram for Common::VirtualMouse:
Collaboration diagram for Common::VirtualMouse:

List of all members.

Public Member Functions

 VirtualMouse (EventDispatcher *eventDispatcher)
 ~VirtualMouse () override
bool pollEvent (Event &event) override
bool notifyEvent (const Event &event) override
 Notifies the observer of an incoming event.
void addActionsToKeymap (Keymap *keymap)
 Add the virtual mouse keymapper actions to a keymap.

Private Types

enum  {
  kCustomActionVirtualAxisUp = 10000, kCustomActionVirtualAxisDown = 10001, kCustomActionVirtualAxisLeft = 10002, kCustomActionVirtualAxisRight = 10003,
  kCustomActionVirtualMouseSlow = 10004
}

Private Member Functions

void handleAxisMotion (int16 axisPositionX, int16 axisPositionY)
float computeJoystickMouseSpeedFactor () const

Private Attributes

EventDispatcher_eventDispatcher
int16 _inputAxisPositionX
int16 _inputAxisPositionY
float _mouseVelocityX
float _mouseVelocityY
float _slowModifier
float _subPixelRemainderX
float _subPixelRemainderY
uint32 _lastUpdateMillis

Static Private Attributes

static const int32 kUpdateDelay = 12
static const int32 kDefaultScreenWidth = 640

Detailed Description

The Virtual Mouse can produce mouse move events on systems without a physical mouse.

It is useful for moving the mouse cursor using a gamepad or a keyboard.

This class defines a keymap with actions for moving the cursor in all four directions. The keymapper produces custom backend events whenever keys bound to these actions are pressed. This class handles the events through its EventObserver interface and produces mouse move events when necesssary through its EventSource interface.

Definition at line 45 of file virtual-mouse.h.


Member Enumeration Documentation

anonymous enum [private]
Enumerator:
kCustomActionVirtualAxisUp 
kCustomActionVirtualAxisDown 
kCustomActionVirtualAxisLeft 
kCustomActionVirtualAxisRight 
kCustomActionVirtualMouseSlow 

Definition at line 63 of file virtual-mouse.h.


Constructor & Destructor Documentation

Common::VirtualMouse::VirtualMouse ( EventDispatcher eventDispatcher  ) 

Definition at line 36 of file virtual-mouse.cpp.

Common::VirtualMouse::~VirtualMouse (  )  [override]

Definition at line 53 of file virtual-mouse.cpp.


Member Function Documentation

void Common::VirtualMouse::addActionsToKeymap ( Keymap keymap  ) 

Add the virtual mouse keymapper actions to a keymap.

Definition at line 151 of file virtual-mouse.cpp.

float Common::VirtualMouse::computeJoystickMouseSpeedFactor (  )  const [private]

Definition at line 201 of file virtual-mouse.cpp.

void Common::VirtualMouse::handleAxisMotion ( int16  axisPositionX,
int16  axisPositionY 
) [private]

Definition at line 180 of file virtual-mouse.cpp.

bool Common::VirtualMouse::notifyEvent ( const Event event  )  [override, virtual]

Notifies the observer of an incoming event.

An observer is supposed to eat the event, with returning true, when it wants to prevent other observers from receiving the event. A usage example here is the keymapper: If it processes an Event, it should 'eat' it and create a new event, which the EventDispatcher will then catch.

Parameters:
event the event, which is incoming.
Returns:
true if the event should not be passed to other observers, false otherwise.

Implements Common::EventObserver.

Definition at line 107 of file virtual-mouse.cpp.

bool Common::VirtualMouse::pollEvent ( Event event  )  [override]

Definition at line 58 of file virtual-mouse.cpp.


Member Data Documentation

Definition at line 76 of file virtual-mouse.h.

Definition at line 77 of file virtual-mouse.h.

Definition at line 86 of file virtual-mouse.h.

Definition at line 79 of file virtual-mouse.h.

Definition at line 80 of file virtual-mouse.h.

Definition at line 81 of file virtual-mouse.h.

Definition at line 83 of file virtual-mouse.h.

Definition at line 84 of file virtual-mouse.h.

const int32 Common::VirtualMouse::kDefaultScreenWidth = 640 [static, private]

Definition at line 61 of file virtual-mouse.h.

const int32 Common::VirtualMouse::kUpdateDelay = 12 [static, private]

Definition at line 60 of file virtual-mouse.h.


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


Generated on Sat Aug 8 2020 05:03:06 for ResidualVM by doxygen 1.7.1
curved edge   curved edge