From 39150a15ea86557ce8360301fe1b539824fefb00 Mon Sep 17 00:00:00 2001 From: Kristian Sloth Lauszus Date: Sun, 18 Jun 2017 18:02:43 +0200 Subject: [PATCH] Also update the ButtonClickState variable when the Xbox button is pressed Fixes #299 --- XBOXONE.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/XBOXONE.cpp b/XBOXONE.cpp index 8411140d..9c5b388f 100644 --- a/XBOXONE.cpp +++ b/XBOXONE.cpp @@ -266,6 +266,11 @@ void XBOXONE::readReport() { ButtonState |= pgm_read_word(&XBOX_BUTTONS[XBOX]); else 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 #ifdef EXTRADEBUG