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

Common::InputWatcher Class Reference

Watches events for inputs that can be bound to actions. More...

#include <input-watcher.h>

Inheritance diagram for Common::InputWatcher:
Collaboration diagram for Common::InputWatcher:

List of all members.

Public Member Functions

 InputWatcher (EventDispatcher *eventDispatcher, Keymapper *keymapper)
void startWatching ()
void stopWatching ()
bool isWatching () const
HardwareInput checkForCapturedInput ()

Private Member Functions

bool notifyEvent (const Event &event) override
 Notifies the observer of an incoming event.

Private Attributes

EventDispatcher_eventDispatcher
Keymapper_keymapper
bool _watching
HardwareInput _hwInput

Detailed Description

Watches events for inputs that can be bound to actions.

When the watch mode is enabled, the watcher disables the Keymapper and sets itself as an event observer. Once an event corresponding to an hardware input is received, it is saved for later retrieval.

Used by the remap dialog to capture input.

Definition at line 44 of file input-watcher.h.


Constructor & Destructor Documentation

Common::InputWatcher::InputWatcher ( EventDispatcher eventDispatcher,
Keymapper keymapper 
)

Definition at line 30 of file input-watcher.cpp.


Member Function Documentation

HardwareInput Common::InputWatcher::checkForCapturedInput (  ) 

Definition at line 92 of file input-watcher.cpp.

bool Common::InputWatcher::isWatching (  )  const

Definition at line 52 of file input-watcher.cpp.

bool Common::InputWatcher::notifyEvent ( const Event event  )  [override, private, 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 56 of file input-watcher.cpp.

void Common::InputWatcher::startWatching (  ) 

Definition at line 37 of file input-watcher.cpp.

void Common::InputWatcher::stopWatching (  ) 

Definition at line 46 of file input-watcher.cpp.


Member Data Documentation

Definition at line 61 of file input-watcher.h.

Definition at line 58 of file input-watcher.h.

Definition at line 60 of file input-watcher.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