#include <virtual-mouse.h>
Public Member Functions | |
VirtualMouse (EventDispatcher *eventDispatcher) | |
bool | pollEvent (Event &event) override |
bool | notifyEvent (const Event &event) override |
void | addActionsToKeymap (Keymap *keymap) |
Public Member Functions inherited from Common::EventSource | |
virtual bool | allowMapping () const |
Public Member Functions inherited from Common::EventObserver | |
virtual void | notifyPoll () |
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.
|
overridevirtual |
Query an event from the source.
event | Reference to the event struct where the event should be stored. |
true | If an event was polled, false otherwise. |
Implements Common::EventSource.
|
overridevirtual |
Notify 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.
event | The event that is incoming. |
true | If the event should not be passed to other observers, false otherwise. |
Implements Common::EventObserver.
void Common::VirtualMouse::addActionsToKeymap | ( | Keymap * | keymap | ) |
Add the virtual mouse keymapper actions to a keymap