Introduce InputBroker

This commit is contained in:
Balazs Kelemen
2022-01-11 16:02:55 +01:00
parent b832b82ec6
commit f5004a66a1
9 changed files with 68 additions and 16 deletions

View File

@@ -0,0 +1,19 @@
#pragma once
#include "Observer.h"
#include "HardwareInput.h"
class InputBroker :
public Observable<const InputEvent *>
{
CallbackObserver<InputBroker, const InputEvent *> inputEventObserver =
CallbackObserver<InputBroker, const InputEvent *>(this, &InputBroker::handleInputEvent);
public:
InputBroker();
void registerOrigin(Observable<const InputEvent *> *origin);
protected:
int handleInputEvent(const InputEvent *event);
};
extern InputBroker *inputBroker;