Don't check input devices on platforms that don't support it
This commit is contained in:
parent
dbfa473034
commit
5b386891f3
|
@ -181,6 +181,8 @@ public class GL2JNIActivity extends Activity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
|
||||||
|
|
||||||
JNIdc.initControllers(new boolean[] {controllerTwoConnected, controllerThreeConnected, controllerFourConnected});
|
JNIdc.initControllers(new boolean[] {controllerTwoConnected, controllerThreeConnected, controllerFourConnected});
|
||||||
|
|
||||||
int joys[] = InputDevice.getDeviceIds();
|
int joys[] = InputDevice.getDeviceIds();
|
||||||
|
@ -279,6 +281,9 @@ public class GL2JNIActivity extends Activity {
|
||||||
OuyaController.BUTTON_R1, key_CONT_START };
|
OuyaController.BUTTON_R1, key_CONT_START };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// When viewing a resource, pass its URI to the native code for opening
|
// When viewing a resource, pass its URI to the native code for opening
|
||||||
|
@ -299,6 +304,8 @@ public class GL2JNIActivity extends Activity {
|
||||||
// Log.w("INPUT", event.toString() + " " + event.getSource());
|
// Log.w("INPUT", event.toString() + " " + event.getSource());
|
||||||
// Get all the axis for the KeyEvent
|
// Get all the axis for the KeyEvent
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
|
||||||
|
|
||||||
Integer playerNum = deviceDescriptor_PlayerNum.get(deviceId_deviceDescriptor.get(event.getDeviceId()));
|
Integer playerNum = deviceDescriptor_PlayerNum.get(deviceId_deviceDescriptor.get(event.getDeviceId()));
|
||||||
|
|
||||||
if (playerNum == null)
|
if (playerNum == null)
|
||||||
|
@ -340,6 +347,11 @@ public class GL2JNIActivity extends Activity {
|
||||||
return false;
|
return false;
|
||||||
else
|
else
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final int key_CONT_B = 0x0002;
|
private static final int key_CONT_B = 0x0002;
|
||||||
|
|
Loading…
Reference in New Issue