diff options
author | endolf <[email protected]> | 2005-05-05 08:07:51 +0000 |
---|---|---|
committer | endolf <[email protected]> | 2005-05-05 08:07:51 +0000 |
commit | d80501af2cede869da2614d1f39663e16324013d (patch) | |
tree | db7bafc32449b2517d7ef7b45485c5834375d7c5 | |
parent | ff38a18f830bb2d12dca0794fceb37e0954240c5 (diff) |
Handle missing absolute axis ID's
git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@90 e343933a-64c8-49c5-92b1-88f2ce3e89e8
-rw-r--r-- | plugins/linux/src/java/net/java/games/input/LinuxNativeTypesMap.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/linux/src/java/net/java/games/input/LinuxNativeTypesMap.java b/plugins/linux/src/java/net/java/games/input/LinuxNativeTypesMap.java index 6fcf06b..fc904f4 100644 --- a/plugins/linux/src/java/net/java/games/input/LinuxNativeTypesMap.java +++ b/plugins/linux/src/java/net/java/games/input/LinuxNativeTypesMap.java @@ -767,7 +767,13 @@ public class LinuxNativeTypesMap { * @return The jinput id */ public static Component.Identifier getAbsAxisID(int nativeID) { - Component.Identifier retval = INSTANCE.absAxesIDs[nativeID]; + Component.Identifier retval = null; + try { + retval = INSTANCE.absAxesIDs[nativeID]; + } catch (ArrayIndexOutOfBoundsException e) { + System.out.println("INSTANCE.absAxesIDs is only " + INSTANCE.absAxesIDs.length + " long, so " + nativeID + " not contained"); + //ignore, pretend it was null + } if(retval == null) { retval = Component.Identifier.Axis.SLIDER; INSTANCE.absAxesIDs[nativeID] = retval; |