aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorelias <[email protected]>2006-08-10 08:05:14 +0000
committerelias <[email protected]>2006-08-10 08:05:14 +0000
commit5d9f44b1beaec1f2f23f32f27c8c5b459f8cf9f0 (patch)
treee30d2c21ce2fd2b0b35f849d1e658b4fa6831c38 /plugins
parent65cf1b9a9fade94ff81e3dafc71ad584e9ecc170 (diff)
DirectInput: Ignore unmapped components
git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@160 e343933a-64c8-49c5-92b1-88f2ce3e89e8
Diffstat (limited to 'plugins')
-rw-r--r--plugins/windows/src/java/net/java/games/input/DIControllers.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/windows/src/java/net/java/games/input/DIControllers.java b/plugins/windows/src/java/net/java/games/input/DIControllers.java
index 0d7f01f..cb4b2d6 100644
--- a/plugins/windows/src/java/net/java/games/input/DIControllers.java
+++ b/plugins/windows/src/java/net/java/games/input/DIControllers.java
@@ -52,13 +52,15 @@ final class DIControllers {
if (!device.getNextEvent(di_event))
return false;
DIDeviceObject object = device.mapEvent(di_event);
+ DIComponent component = device.mapObject(object);
+ if (component == null)
+ return false;
int event_value;
if (object.isRelative()) {
event_value = object.getRelativeEventValue(di_event.getData());
} else {
event_value = di_event.getData();
}
- DIComponent component = device.mapObject(object);
event.set(component, component.getDeviceObject().convertValue(event_value), di_event.getNanos());
return true;
}