1 #ifndef MSP_INPUT_GAMECONTROLLER_PLATFORM_H_
2 #define MSP_INPUT_GAMECONTROLLER_PLATFORM_H_
4 #include <msp/io/eventobject.h>
5 #include <msp/io/handle.h>
10 class JsDevice: public IO::EventObject
16 JsDevice(const std::string &);
19 std::string get_name() const;
21 void set_block(bool) override { }
22 void set_inherit(bool) override { }
25 std::size_t do_read(char *, std::size_t) override;
26 std::size_t do_write(const char *, std::size_t) override;
29 const IO::Handle &get_handle(IO::Mode) override { return handle; }
30 const IO::Handle &get_event_handle() override { return handle; }
34 struct GameController::Private
36 JsDevice *dev = nullptr;
38 static std::vector<std::string> detected_controllers;