1
0
mirror of https://github.com/cathery/sys-con.git synced 2024-07-01 01:38:44 +00:00

Added deadzone to close #8

Xbox One sync button now takes a capture
This commit is contained in:
cathery 2019-11-05 22:44:44 +03:00
parent 4d498a211d
commit f0419185f4
5 changed files with 19 additions and 18 deletions

View File

@ -155,8 +155,8 @@ private:
Dualshock3ButtonData m_buttonData;
int8_t kLeftThumbDeadzone = 0;
int8_t kRightThumbDeadzone = 0;
int8_t kLeftThumbDeadzone = 10;
int8_t kRightThumbDeadzone = 10;
int8_t kTriggerMax = 0;
int8_t kTriggerDeadzone = 0;

View File

@ -51,10 +51,10 @@ private:
Dualshock4ButtonData m_buttonData;
int16_t kLeftThumbDeadzone = 0; //7849;
int16_t kRightThumbDeadzone = 0; //8689;
uint16_t kTriggerMax = 0; //1023;
uint16_t kTriggerDeadzone = 0; //120;
int16_t kLeftThumbDeadzone = 2000; //7849;
int16_t kRightThumbDeadzone = 2000; //8689;
uint16_t kTriggerMax = 0; //1023;
uint16_t kTriggerDeadzone = 0; //120;
public:
Dualshock4Controller(std::unique_ptr<IUSBDevice> &&interface);

View File

@ -68,10 +68,10 @@ private:
Xbox360ButtonData m_buttonData;
int16_t kLeftThumbDeadzone = 0; //7849;
int16_t kRightThumbDeadzone = 0; //8689;
uint16_t kTriggerMax = 0; //1023;
uint16_t kTriggerDeadzone = 0; //120;
int16_t kLeftThumbDeadzone = 8000; //7849;
int16_t kRightThumbDeadzone = 8000; //8689;
uint16_t kTriggerMax = 0; //1023;
uint16_t kTriggerDeadzone = 0; //120;
public:
Xbox360Controller(std::unique_ptr<IUSBDevice> &&interface);

View File

@ -79,11 +79,12 @@ private:
IUSBEndpoint *m_outPipe = nullptr;
XboxOneButtonData m_buttonData;
bool m_GuidePressed;
int16_t kLeftThumbDeadzone = 0; //7849;
int16_t kRightThumbDeadzone = 0; //8689;
uint16_t kTriggerMax = 0; //1023;
uint16_t kTriggerDeadzone = 0; //120;
int16_t kLeftThumbDeadzone = 2500; //7849;
int16_t kRightThumbDeadzone = 3500; //8689;
uint16_t kTriggerMax = 0; //1023;
uint16_t kTriggerDeadzone = 0; //120;
uint8_t m_rumbleDataCounter = 0;
public:
@ -109,5 +110,5 @@ public:
Status SendInitBytes();
Status WriteAckGuideReport(uint8_t sequence);
Status SetRumble(uint8_t strong_magnitude,uint8_t weak_magnitude);
Status SetRumble(uint8_t strong_magnitude, uint8_t weak_magnitude);
};

View File

@ -95,7 +95,7 @@ Status XboxOneController::GetInput()
}
else if (type == XBONEINPUT_GUIDEBUTTON) //Guide button status
{
m_buttonData.sync = input_bytes[4];
m_GuidePressed = input_bytes[4];
//Xbox one S needs to be sent an ack report for guide buttons
//TODO: needs testing
@ -188,10 +188,10 @@ NormalizedButtonData XboxOneController::GetNormalizedButtonData()
normalData.left_stick_click = m_buttonData.stick_left_click;
normalData.right_stick_click = m_buttonData.stick_right_click;
normalData.capture = false;
normalData.capture = m_buttonData.sync;
normalData.home = false;
normalData.guide = m_buttonData.sync;
normalData.guide = m_GuidePressed;
normalData.left_trigger = NormalizeTrigger(m_buttonData.trigger_left);
normalData.right_trigger = NormalizeTrigger(m_buttonData.trigger_right);