Also update the ButtonClickState variable when the Xbox button is pressed

Fixes #299
This commit is contained in:
Kristian Sloth Lauszus 2017-06-18 18:02:43 +02:00
parent e7d0695616
commit 39150a15ea

View file

@ -266,6 +266,11 @@ void XBOXONE::readReport() {
ButtonState |= pgm_read_word(&XBOX_BUTTONS[XBOX]); ButtonState |= pgm_read_word(&XBOX_BUTTONS[XBOX]);
else else
ButtonState &= ~pgm_read_word(&XBOX_BUTTONS[XBOX]); ButtonState &= ~pgm_read_word(&XBOX_BUTTONS[XBOX]);
if(ButtonState != OldButtonState) {
ButtonClickState = ButtonState & ~OldButtonState; // Update click state variable
OldButtonState = ButtonState;
}
} }
if(readBuf[0] != 0x20) { // Check if it's the correct report, otherwise return - the controller also sends different status reports if(readBuf[0] != 0x20) { // Check if it's the correct report, otherwise return - the controller also sends different status reports
#ifdef EXTRADEBUG #ifdef EXTRADEBUG