Browse Source

Merge pull request #1490 from seanpaultaylor/next

Next
Sean Taylor 11 years ago
parent
commit
f0819da2fc
1 changed files with 4 additions and 1 deletions
  1. 4 1
      gameplay/src/PlatformLinux.cpp

+ 4 - 1
gameplay/src/PlatformLinux.cpp

@@ -1036,11 +1036,14 @@ void handleConnectedGamepad(dev_t devId, const char* devPath, const char* sysFSI
     unsigned int numJS = gpInfo.numberOfJS;
     unsigned int numTR = gpInfo.numberOfTriggers;
 
+    // Ignore accelerometer devices that register themselves as joysticks. Ensure they have at least 2 buttons.s
+    if (btnsNum < 2)
+        return;
 
     Platform::gamepadEventConnectedInternal(handle,btnsNum,numJS,numTR,vendorId,productId,"",name);
-
     ConnectedGamepadDevInfo info = {devId,handle,gpInfo}; 
     __connectedGamepads.push_back(info);
+    
 }
 
 static float normalizeJoystickAxis(int axisValue, int deadZone, bool zeroToOne)