1 #ifndef MSP_INPUT_GAMECONTROLLER_PLATFORM_H_
2 #define MSP_INPUT_GAMECONTROLLER_PLATFORM_H_
6 #include <msp/core/thread.h>
7 #include <msp/io/pipe.h>
8 #include <msp/time/timer.h>
13 class GameControllerTimerThread: public Msp::Thread
19 static GameControllerTimerThread *thread;
21 GameControllerTimerThread();
22 ~GameControllerTimerThread();
24 static Time::Timer::Slot &add_slot();
25 static void remove_slot(Time::Timer::Slot &);
32 struct GameController::Private
35 unsigned last_packet_number = 0;
36 IO::Pipe *event_pipe = 0;
37 Time::Timer::Slot *timer_slot = 0;
39 static std::vector<unsigned> detected_controllers;
41 bool generate_event();
43 void update_state(GameController &, const XINPUT_STATE &, bool);