--- /dev/null
+#ifndef MSP_INPUT_GAMECONTROLLER_PLATFORM_H_
+#define MSP_INPUT_GAMECONTROLLER_PLATFORM_H_
+
+#include <windows.h>
+#include <xinput.h>
+#include <msp/core/thread.h>
+#include <msp/io/pipe.h>
+#include <msp/time/timer.h>
+
+namespace Msp {
+namespace Input {
+
+class GameControllerTimerThread: public Msp::Thread
+{
+private:
+ Time::Timer timer;
+ unsigned n_users;
+
+ static GameControllerTimerThread *thread;
+
+ GameControllerTimerThread();
+ ~GameControllerTimerThread();
+public:
+ static Time::Timer::Slot &add_slot();
+ static void remove_slot(Time::Timer::Slot &);
+
+private:
+ virtual void main();
+};
+
+
+struct GameController::Private
+{
+ unsigned index;
+ unsigned last_packet_number;
+ IO::Pipe *event_pipe;
+ Time::Timer::Slot *timer_slot;
+
+ static std::vector<unsigned> detected_controllers;
+
+ Private();
+
+ bool generate_event();
+
+ void update_state(GameController &, const XINPUT_STATE &, bool);
+
+};
+
+} // namespace Input
+} // namespace Msp
+
+#endif