summaryrefslogtreecommitdiffstats
path: root/plugins/linux/src/native/eventInterface.cpp
diff options
context:
space:
mode:
authorendolf <[email protected]>2003-10-04 12:48:51 +0000
committerendolf <[email protected]>2003-10-04 12:48:51 +0000
commitf73d0b8719fe82e2e362685ae8c8451fa48572dd (patch)
treea399ccf435e007be0331a92df118307c55d72189 /plugins/linux/src/native/eventInterface.cpp
parente9fb8f194a4e54e067bee7850173c47285836b39 (diff)
Fix and updated error messages for issue 20
git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@53 e343933a-64c8-49c5-92b1-88f2ce3e89e8
Diffstat (limited to 'plugins/linux/src/native/eventInterface.cpp')
-rw-r--r--plugins/linux/src/native/eventInterface.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/plugins/linux/src/native/eventInterface.cpp b/plugins/linux/src/native/eventInterface.cpp
index 303c667..654a0bd 100644
--- a/plugins/linux/src/native/eventInterface.cpp
+++ b/plugins/linux/src/native/eventInterface.cpp
@@ -95,16 +95,24 @@ int evInit() {
evNumDevices = 0;
for(i=0;i<numDeviceFiles;i++) {
- tempDeviceList[i] = new EventDevice(deviceFileNames[i]);
- if(tempDeviceList[i]->getBusType()!=-1) {
+ EventDevice *tempDevice = new EventDevice(deviceFileNames[i]);
+ if(tempDevice->isValidDevice()==1) {
+ tempDeviceList[i] = tempDevice;
evNumDevices++;
}
}
+ int highDeviceCountNumber = i;
+ int evTempDeviceCount = 0;
// Now we know for certain which devices are open, we can take notes
evDeviceList = (Device **)malloc(evNumDevices * sizeof(Device *));
for(i=0;i<evNumDevices;i++) {
- evDeviceList[i] = tempDeviceList[i];
+ while(tempDeviceList[evTempDeviceCount] == NULL) {
+ evTempDeviceCount++;
+ }
+ evDeviceList[i] = tempDeviceList[evTempDeviceCount];
+ //printf("Copied device %d to %d\n", evTempDeviceCount, i);
+ evTempDeviceCount++;
}
evInited=1;