finished input

This commit is contained in:
Jonas Zeunert
2018-04-27 01:46:43 +02:00
parent 65bf3e5958
commit 20b5be8bfa
4 changed files with 17373 additions and 21 deletions

View File

@@ -16,7 +16,7 @@
#include "InputEvent.h"
#include "InputEventHandler.h"
#define SLEEP_DURATION 0.1f
#define SLEEP_DURATION 10
namespace Input
{
@@ -24,7 +24,7 @@ namespace Input
class Detector
{
public:
Detector(std::set<InputEvent*> events);
Detector(std::map<std::string, char> input_config, std::set<InputEvent> events);
~Detector();
void register_input_event_handler(InputEventHandler* handler);
@@ -35,12 +35,12 @@ private:
bool check_inputs(char& address);
void notify_handlers(InputEvent& event);
InputEvent* find_event(char address);
InputEvent& find_event(char address);
private:
std::map<std::string, char> gpio;
std::set<InputEvent*> input_events;
std::set<InputEvent> input_events;
std::set<InputEventHandler*> event_handler;
std::thread detect_thread;