]> git.tdb.fi Git - libs/gui.git/blobdiff - source/input/linux/gamecontroller_platform.h
Add a game controller input device
[libs/gui.git] / source / input / linux / gamecontroller_platform.h
diff --git a/source/input/linux/gamecontroller_platform.h b/source/input/linux/gamecontroller_platform.h
new file mode 100644 (file)
index 0000000..61bcdb5
--- /dev/null
@@ -0,0 +1,37 @@
+#ifndef GAMECONTROLLER_PRIVATE_H_
+#define GAMECONTROLLER_PRIVATE_H_
+
+#include <msp/io/eventobject.h>
+#include <msp/io/handle.h>
+
+namespace Msp {
+namespace Input {
+
+class JsDevice: public IO::EventObject
+{
+private:
+       IO::Handle handle;
+
+public:
+       JsDevice(const std::string &);
+
+       std::string get_name() const;
+
+protected:
+       virtual unsigned do_read(char *, unsigned);
+       virtual unsigned do_write(const char *, unsigned);
+
+public:
+       virtual const IO::Handle &get_event_handle() { return handle; }
+};
+
+
+struct GameController::Private
+{
+       JsDevice *dev;
+};
+
+} // namespace Input
+} // namespace Msp
+
+#endif