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

Conversation

MTareqAzim
Copy link
Contributor

@MTareqAzim MTareqAzim commented Jun 11, 2024

Due to a change made in commit ab9e377, left joystick motion inputs don't get properly registered. I reordered the guards in the onGenericMotionEvent() function so that joystick inputs don't get sent to the GodotGestureHandler in the first place.

I believe the GodotGestureHandler should not have to make an exception for that one function and do an event source check. Every other function in it is able to assume only the events with the proper sources are sent to it. However, a maintainer with a better overview of the systems should give their opinion.

Fixes #92939

@MTareqAzim MTareqAzim force-pushed the fix-android-motion-event-guards branch from 18512bb to 4450983 Compare June 11, 2024 03:29
@MTareqAzim MTareqAzim marked this pull request as ready for review June 11, 2024 03:56
@MTareqAzim MTareqAzim requested a review from a team as a code owner June 11, 2024 03:56
@MTareqAzim MTareqAzim marked this pull request as draft June 11, 2024 04:03
@MTareqAzim
Copy link
Contributor Author

Wait, I realized one mistake where I don't keep parity with the previous structure.

@MTareqAzim MTareqAzim force-pushed the fix-android-motion-event-guards branch from 4450983 to d14bea4 Compare June 11, 2024 04:17
@MTareqAzim
Copy link
Contributor Author

Hopefully this keeps parity with the initial intent of the code. Any joystick motion event from a non-existent device should return false as it did previously, but expedited now.

@MTareqAzim MTareqAzim marked this pull request as ready for review June 11, 2024 04:29
@m4gr3d m4gr3d added this to the 4.3 milestone Jun 12, 2024
Copy link
Contributor

@m4gr3d m4gr3d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic looks good, thanks for the fix!

@akien-mga akien-mga merged commit e78db2c into godotengine:master Jun 12, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@akien-mga akien-mga changed the title Fix Left Joystick Motion Not Registering on Android Fix Left Joystick motion not registering on Android Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Very Bad
Development

Successfully merging this pull request may close these issues.

Android: InputEventJoypadMotions Not Registering for Left Joystick
3 participants