mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
parent
99dcb14582
commit
404a662383
@ -509,6 +509,10 @@ public class EbitenView extends ViewGroup implements InputManager.InputDeviceLis
|
|||||||
@Override
|
@Override
|
||||||
public void onInputDeviceAdded(int deviceId) {
|
public void onInputDeviceAdded(int deviceId) {
|
||||||
InputDevice inputDevice = this.inputManager.getInputDevice(deviceId);
|
InputDevice inputDevice = this.inputManager.getInputDevice(deviceId);
|
||||||
|
// The InputDevice can be null on some deivces (#1342).
|
||||||
|
if (inputDevice == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
int sources = inputDevice.getSources();
|
int sources = inputDevice.getSources();
|
||||||
if ((sources & InputDevice.SOURCE_GAMEPAD) != InputDevice.SOURCE_GAMEPAD &&
|
if ((sources & InputDevice.SOURCE_GAMEPAD) != InputDevice.SOURCE_GAMEPAD &&
|
||||||
(sources & InputDevice.SOURCE_JOYSTICK) != InputDevice.SOURCE_JOYSTICK) {
|
(sources & InputDevice.SOURCE_JOYSTICK) != InputDevice.SOURCE_JOYSTICK) {
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user