mirror of
https://github.com/meshtastic/firmware.git
synced 2026-01-01 15:40:49 +00:00
Introduce InputBroker
This commit is contained in:
19
src/plugins/input/InputBroker.h
Normal file
19
src/plugins/input/InputBroker.h
Normal 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;
|
||||
Reference in New Issue
Block a user