Handle missing absolute axis ID's

This commit is contained in:
endolf 2005-05-05 08:07:51 +00:00
parent e48688ce73
commit fc587842d0

View file

@ -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;