mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
bug fix: would only detect first XBOX button press
This commit is contained in:
parent
9979e50426
commit
199612e93e
1 changed files with 3 additions and 3 deletions
|
@ -262,10 +262,10 @@ void XBOXONE::readReport() {
|
|||
ButtonState |= XBOX_BUTTONS[XBOX];
|
||||
}
|
||||
else {
|
||||
ButtonState &= XBOX_BUTTONS[XBOX];
|
||||
ButtonState &= ~XBOX_BUTTONS[XBOX];
|
||||
}
|
||||
if(ButtonState != OldButtonState) {
|
||||
ButtonClickState = ButtonState & ~OldButtonState; // Update click state variable, but don't include the two trigger buttons L2 and R2
|
||||
ButtonClickState = ButtonState & ~OldButtonState; // Update click state variable
|
||||
OldButtonState = ButtonState;
|
||||
}
|
||||
}
|
||||
|
@ -296,7 +296,7 @@ void XBOXONE::readReport() {
|
|||
ButtonClickState = ButtonState & ~OldButtonState; // Update click state variable
|
||||
OldButtonState = ButtonState;
|
||||
}
|
||||
|
||||
// handle click detection for triggers
|
||||
if (triggerValue[0] != triggerValueOld[0]) {
|
||||
triggerValueOld[0] = triggerValue[0];
|
||||
L2Clicked = true;
|
||||
|
|
Loading…
Reference in a new issue