Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ public class GodotInputHandler implements InputManager.InputDeviceListener, Sens
private static final int ROTARY_INPUT_VERTICAL_AXIS = 1;
private static final int ROTARY_INPUT_HORIZONTAL_AXIS = 0;

private static final String[] JOYPAD_IGNORE_LIST = new String[] {
// Ignore fingerprint scanners.
"uinput-fpc",
"uinput-goodix",
"uinput-synaptics",
"uinput-elan",
"uinput-vfs",
"uinput-atrus",
};

private final SparseIntArray mJoystickIds = new SparseIntArray(4);
private final SparseArray<Joystick> mJoysticksDevices = new SparseArray<>(4);
private final HashSet<Integer> mHardwareKeyboardIds = new HashSet<>();
Expand Down Expand Up @@ -359,6 +369,13 @@ public void onInputDeviceAdded(int deviceId) {
return;
}

for (String name : JOYPAD_IGNORE_LIST) {
if (device.getName().equals(name)) {
Log.i(TAG, "=== Input Device ignored: " + device.getName());
return;
}
}

// Assign first available number. Reuse numbers where possible.
final int id = assignJoystickIdNumber(deviceId);

Expand Down