Fix button signals.
authorRuediger Gad <rgad@fb2.fh-frankfurt.de>
Thu, 12 Apr 2012 11:40:54 +0000 (13:40 +0200)
committerRuediger Gad <rgad@fb2.fh-frankfurt.de>
Thu, 12 Apr 2012 11:40:54 +0000 (13:40 +0200)
btconnector.cpp

index bfa75b8..48e7959 100644 (file)
@@ -94,8 +94,8 @@ void BtConnector::readData(){
         emit(buttonsChanged(buttonMap & 0x01, buttonMap & 0x02, buttonMap & 0x04, buttonMap & 0x08));
 
         for(int i = 0; i <= 3; i++){
-            if(buttonMap | (oldButtonMap << i)){
-                bool val = (buttonMap ^ (1 << i));
+            if(((buttonMap | oldButtonMap) & (1 << i)) > 0){
+                bool val = (buttonMap & (1 << i)) > 0;
                 switch (i){
                 case 0:
                     _a = val;