iw4x-client/src/Components/Modules/XInput.hpp

54 lines
1.3 KiB
C++
Raw Normal View History

2021-01-02 01:49:45 -05:00
#pragma once
namespace Components
{
class XInput : public Component
{
public:
XInput();
struct ActionMapping {
int input;
std::string action;
bool isReversible;
bool wasPressed = false;
bool spamWhenHeld = false;
ActionMapping(int input, std::string action, bool isReversible = true, bool spamWhenHeld = false)
{
this->action = action;
this->isReversible = isReversible;
this->input = input;
this->spamWhenHeld = spamWhenHeld;
}
};
2021-01-02 01:49:45 -05:00
private:
2021-01-02 02:17:37 -05:00
static XINPUT_STATE xiStates[XUSER_MAX_COUNT];
2021-01-02 14:42:52 -05:00
static int xiPlayerNum;
static XINPUT_STATE lastXiState;
static bool isHoldingMaxLookX;
static std::chrono::milliseconds timeAtFirstHeldMaxLookX;
static std::chrono::milliseconds msBeforeUnlockingSensitivity;
static float lockedSensitivityMultiplier;
static float generalXSensitivityMultiplier;
static float generalYSensitivityMultiplier;
static void Vibrate(int leftVal = 0, int rightVal = 0);
2021-01-02 02:17:37 -05:00
static void CL_FrameStub();
static void PollXInputDevices();
static void CL_CreateCmdStub();
static void CL_GamepadMove(int, Game::usercmd_s*);
static void MSG_WriteDeltaUsercmdKeyStub();
static void ApplyMovement(Game::msg_t* msg, int key, Game::usercmd_s* from, Game::usercmd_s* to);
static void MSG_ReadDeltaUsercmdKeyStub();
static void MSG_ReadDeltaUsercmdKeyStub2();
};
2021-01-02 01:49:45 -05:00
}