mirror of
https://github.com/shadowfacts/jinput-arm64.git
synced 2026-01-24 01:20:33 +01:00
Handle missing absolute axis ID's
This commit is contained in:
parent
e48688ce73
commit
fc587842d0
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue