]> git.sesse.net Git - ultimatescore/blobdiff - client/event_device.h
Add some support in the client for reading key events from a non-core IPv6 Buddy.
[ultimatescore] / client / event_device.h
diff --git a/client/event_device.h b/client/event_device.h
new file mode 100644 (file)
index 0000000..134a547
--- /dev/null
@@ -0,0 +1,26 @@
+#ifndef _EVENTDEVICE_H
+#define _EVENTDEVICE_H 1
+
+#include <string>
+#include <set>
+#include <thread>
+#include <utility>
+
+class QObject;
+
+class EventDevice {
+private:
+       int fd;
+       std::set<std::pair<unsigned, unsigned>> accepted_usb_ids;
+       std::thread thr;
+       QObject *receiver;
+
+       void init();
+       void thread_func();
+
+public:
+       EventDevice(const std::set<std::pair<unsigned, unsigned>> &accepted_usb_ids, QObject *receiver);
+       void start_thread();
+};
+
+#endif /* !defined(_EVENTDEVICE_H) */