2012-11-12 15:38:21 +00:00
|
|
|
#pragma once
|
2013-07-22 22:06:07 +00:00
|
|
|
|
2021-02-14 17:25:20 +00:00
|
|
|
#include <XInput.h>
|
2020-04-12 13:08:46 +00:00
|
|
|
#include "Core/HLE/sceCtrl.h"
|
2021-02-14 17:25:20 +00:00
|
|
|
#include "Windows/InputDevice.h"
|
2013-07-22 22:06:07 +00:00
|
|
|
|
2019-06-28 22:55:45 +00:00
|
|
|
class XinputDevice final : public InputDevice {
|
2012-11-12 15:38:21 +00:00
|
|
|
public:
|
|
|
|
XinputDevice();
|
2013-07-22 22:06:07 +00:00
|
|
|
~XinputDevice();
|
2022-12-11 04:32:12 +00:00
|
|
|
int UpdateState() override;
|
2017-02-19 14:02:17 +00:00
|
|
|
|
2012-11-12 15:38:21 +00:00
|
|
|
private:
|
2020-04-12 13:08:46 +00:00
|
|
|
void UpdatePad(int pad, const XINPUT_STATE &state, XINPUT_VIBRATION &vibration);
|
2017-03-15 05:01:18 +00:00
|
|
|
void ApplyButtons(int pad, const XINPUT_STATE &state);
|
2020-04-12 13:08:46 +00:00
|
|
|
void ApplyVibration(int pad, XINPUT_VIBRATION &vibration);
|
2017-02-19 14:02:17 +00:00
|
|
|
int check_delay[4]{};
|
|
|
|
XINPUT_STATE prevState[4]{};
|
2020-04-12 13:08:46 +00:00
|
|
|
XINPUT_VIBRATION prevVibration[4]{};
|
2020-10-08 21:49:14 +00:00
|
|
|
double prevVibrationTime = 0.0;
|
2023-07-06 13:47:36 +00:00
|
|
|
float prevAxisValue_[4][6]{};
|
|
|
|
bool notified_[XUSER_MAX_COUNT]{};
|
|
|
|
u32 prevButtons_[4]{};
|
2023-11-11 10:08:22 +00:00
|
|
|
double newVibrationTime_ = 0.0;
|
2017-03-15 05:01:18 +00:00
|
|
|
};
|