2014-05-24 19:05:00 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "Emu/Io/PadHandler.h"
|
|
|
|
#include <Xinput.h>
|
|
|
|
|
2016-02-01 21:51:09 +00:00
|
|
|
class XInputPadHandler final : public PadHandlerBase
|
2014-05-24 19:05:00 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
XInputPadHandler();
|
|
|
|
~XInputPadHandler();
|
|
|
|
|
|
|
|
void Init(const u32 max_connect) override;
|
2016-02-01 21:51:09 +00:00
|
|
|
void Close();
|
2014-05-24 19:05:00 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
typedef void (WINAPI * PFN_XINPUTENABLE)(BOOL);
|
|
|
|
typedef DWORD (WINAPI * PFN_XINPUTGETSTATE)(DWORD, XINPUT_STATE *);
|
|
|
|
|
|
|
|
private:
|
|
|
|
DWORD ThreadProcedure();
|
|
|
|
static DWORD WINAPI ThreadProcProxy(LPVOID parameter);
|
|
|
|
|
|
|
|
private:
|
|
|
|
mutable bool active;
|
|
|
|
HANDLE thread;
|
|
|
|
HMODULE library;
|
|
|
|
PFN_XINPUTGETSTATE xinputGetState;
|
|
|
|
PFN_XINPUTENABLE xinputEnable;
|
|
|
|
|
|
|
|
};
|