Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Left Joystick motion not registering on Android #93011

Merged
Merged
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 @@ -228,16 +228,6 @@ public boolean onTouchEvent(final MotionEvent event) {
public boolean onGenericMotionEvent(MotionEvent event) {
lastSeenToolType = getEventToolType(event);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && gestureDetector.onGenericMotionEvent(event)) {
// The gesture detector has handled the event.
return true;
}

if (godotGestureHandler.onMotionEvent(event)) {
// The gesture handler has handled the event.
return true;
}

if (event.isFromSource(InputDevice.SOURCE_JOYSTICK) && event.getActionMasked() == MotionEvent.ACTION_MOVE) {
// Check if the device exists
final int deviceId = event.getDeviceId();
Expand Down Expand Up @@ -273,11 +263,20 @@ public boolean onGenericMotionEvent(MotionEvent event) {
}
return true;
}
} else {
return handleMouseEvent(event);
return false;
}

return false;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M && gestureDetector.onGenericMotionEvent(event)) {
// The gesture detector has handled the event.
return true;
}

if (godotGestureHandler.onMotionEvent(event)) {
// The gesture handler has handled the event.
return true;
}

return handleMouseEvent(event);
}

public void initInputDevices() {
Expand Down
Loading