aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorendolf <[email protected]>2007-06-28 20:38:53 +0000
committerendolf <[email protected]>2007-06-28 20:38:53 +0000
commitb2ed3b49ce0a0ea1b022bfb3b52ef938a72f3d72 (patch)
treeb913508005a3f667a0403a77a7b517513ddf6bc9
parent56e0e6811b57f4628810b47122ce302e3da4094b (diff)
Don't create devices that are of an unknown type, with no components
git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@190 e343933a-64c8-49c5-92b1-88f2ce3e89e8
-rw-r--r--plugins/windows/src/java/net/java/games/input/DirectInputEnvironmentPlugin.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugins/windows/src/java/net/java/games/input/DirectInputEnvironmentPlugin.java b/plugins/windows/src/java/net/java/games/input/DirectInputEnvironmentPlugin.java
index 5e31bad..d61748e 100644
--- a/plugins/windows/src/java/net/java/games/input/DirectInputEnvironmentPlugin.java
+++ b/plugins/windows/src/java/net/java/games/input/DirectInputEnvironmentPlugin.java
@@ -174,7 +174,10 @@ public final class DirectInputEnvironmentPlugin extends ControllerEnvironment im
private final AbstractController createControllerFromDevice(IDirectInputDevice device, Controller.Type type) {
Component[] components = createComponents(device, false);
- AbstractController controller = new DIAbstractController(device, components, new Controller[]{}, device.getRumblers(), type);
+ AbstractController controller = null;
+ if(type == Controller.Type.UNKNOWN && components.length>0) {
+ controller = new DIAbstractController(device, components, new Controller[]{}, device.getRumblers(), type);
+ }
return controller;
}