mirror of
https://github.com/felis/USB_Host_Shield_2.0.git
synced 2024-03-22 11:31:26 +01:00
Fixed getButtonClick for analog buttons
This commit is contained in:
parent
90dba71937
commit
332f56f46d
1 changed files with 4 additions and 2 deletions
|
@ -299,9 +299,11 @@ bool XBOXOLD::getButtonClick(Button b) {
|
|||
uint8_t button;
|
||||
if (b == A || b == B || b == X || b == Y || b == BLACK || b == WHITE || b == L1 || b == R1) { // A, B, X, Y, BLACK, WHITE, L1, and R1 are analog buttons
|
||||
button = pgm_read_byte(&XBOXOLDBUTTONS[(uint8_t)b]);
|
||||
if (buttonClicked[button])
|
||||
if (buttonClicked[button]) {
|
||||
buttonClicked[button] = false;
|
||||
return buttonClicked[button];
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
button = pgm_read_byte(&XBOXOLDBUTTONS[(uint8_t)b]); // Digital buttons
|
||||
|
|
Loading…
Reference in a new issue