git-svn-id: https://openitg.svn.sourceforge.net/svnroot/openitg@95 83fadc84-e282...
authorPatrick McIlroy <itgpmc@gmail.com>
Tue, 4 Mar 2008 16:39:14 +0000 (16:39 +0000)
committerPatrick McIlroy <itgpmc@gmail.com>
Tue, 4 Mar 2008 16:39:14 +0000 (16:39 +0000)
src/arch/InputHandler/InputHandler_Linux_PIUIO.cpp

index e9061e4..6561126 100644 (file)
@@ -161,6 +161,17 @@ void InputHandler_Linux_PIUIO::HandleInput()
        }
 }
 
+CString SensorDescriptions[] = {"right", "left", "bottom", "top"};
+
+CString GetSensorDescription(int bits) {
+       if (bits == 0) return "";
+       CStringArray retSensors;
+       for(int i = 0; i < 3; i++) {
+               if (bits & (1 << i)) retSensors.push_back(SensorDescriptions[i]);
+       }
+       return join(", ", retSensors);
+}
+
 /* Requires "LightsDriver=ext" */
 void InputHandler_Linux_PIUIO::UpdateLights()
 {