diff options
Diffstat (limited to 'backends/events/default/default-events.h')
-rw-r--r-- | backends/events/default/default-events.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/backends/events/default/default-events.h b/backends/events/default/default-events.h index 9be90f4ad8..4124dd956b 100644 --- a/backends/events/default/default-events.h +++ b/backends/events/default/default-events.h @@ -53,7 +53,26 @@ class DefaultEventManager : public Common::EventManager { bool _remap; #endif - Common::Queue<Common::Event> _artificialEventQueue; + // TODO: Maybe move this to common/events.h, when other code uses something similar + class ArtificialEventSource : public Common::EventSource { + private: + Common::Queue<Common::Event> _artificialEventQueue; + public: + void addEvent(const Common::Event &ev) { + _artificialEventQueue.push(ev); + } + + bool pollEvent(Common::Event &ev) { + if (!_artificialEventQueue.empty()) { + ev = _artificialEventQueue.pop(); + return true; + } else { + return false; + } + } + + bool allowMapping() const { return false; } + } _artificialEventSource; Common::Point _mousePos; int _buttonState; |