From 332f56f46d76e57bf12425ba9b589dee9e28a574 Mon Sep 17 00:00:00 2001 From: Kristian Sloth Lauszus Date: Tue, 8 Oct 2013 16:02:20 +0200 Subject: [PATCH] Fixed getButtonClick for analog buttons --- XBOXOLD.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/XBOXOLD.cpp b/XBOXOLD.cpp index f766e329..4c9bcb20 100644 --- a/XBOXOLD.cpp +++ b/XBOXOLD.cpp @@ -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