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

Android: Allow Mouse Capture #43249

Merged

Conversation

thebestnom
Copy link
Contributor

@thebestnom thebestnom commented Nov 1, 2020

Allow mouse capture in android
Tested with https://github.com/thebestnom/Android-Tester

Im not 100% sure about where to with capture, currently I just clicked the last place before the capture (you can see that when the button will be continue to click even after the capture in the test app)

I'll cherrypick to 3.2 once the PR is approved

@m4gr3d
Copy link
Contributor

m4gr3d commented Nov 12, 2020

@thebestnom For my own education, what does mouse capture allow you to accomplish?

@thebestnom
Copy link
Contributor Author

Mouse capture in android term is the ability to make the mouse relative and not based on location and hide the cursor (for fps style controls for example)

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.

One feedback, otherwise it looks good code wise.

platform/android/java_godot_view_wrapper.cpp Show resolved Hide resolved
@thebestnom
Copy link
Contributor Author

After rebasing to master it stopped working, Im testing to see why

@thebestnom
Copy link
Contributor Author

thebestnom commented Dec 7, 2020

@m4gr3d Ok, I found a bug on gdscript interpreter on android (or something of that kind)
image

you can see here the code, on windows it works as intended, but you can see in the code image what happnes... that so weird

trying to make minimal code to repreduce that

@thebestnom thebestnom force-pushed the captured-mouse-android-support branch 2 times, most recently from e9887c3 to ce103c1 Compare December 7, 2020 23:47
@thebestnom
Copy link
Contributor Author

This is looking like this is working, after 3 branch and cursor shape (that I'm already have working) Ill try to repreduce the bug minimaly

Also custom shape from native to java is hard

@thebestnom thebestnom force-pushed the captured-mouse-android-support branch from ce103c1 to b31d746 Compare December 8, 2020 00:00
@thebestnom thebestnom requested a review from m4gr3d December 8, 2020 01:54
@m4gr3d
Copy link
Contributor

m4gr3d commented Dec 8, 2020

@m4gr3d Ok, I found a bug on gdscript interpreter on android (or something of that kind)
image

you can see here the code, on windows it works as intended, but you can see in the code image what happnes... that so weird

trying to make minimal code to repreduce that

That's very strange! @vnen Any idea what may be happening here?

@m4gr3d m4gr3d requested review from pouleyKetchoupp and a team December 8, 2020 16:19
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.

Looks good! I've added some cleanup and code health feedback, and it should be good for approval once they're resolved.

platform/android/java_godot_view_wrapper.cpp Show resolved Hide resolved
platform/android/java_godot_wrapper.cpp Outdated Show resolved Hide resolved
platform/android/java_godot_wrapper.cpp Outdated Show resolved Hide resolved
platform/android/java_godot_wrapper.h Outdated Show resolved Hide resolved
platform/android/java_godot_view_wrapper.h Outdated Show resolved Hide resolved
@thebestnom thebestnom force-pushed the captured-mouse-android-support branch from b31d746 to 021572f Compare December 8, 2020 19:53
@thebestnom
Copy link
Contributor Author

thebestnom commented Dec 8, 2020

Fixed review 👍

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.

One minor feedback but looks good overall!

platform/android/java_godot_view_wrapper.cpp Show resolved Hide resolved
@thebestnom thebestnom force-pushed the captured-mouse-android-support branch from 021572f to e7f259c Compare December 8, 2020 20:14
@akien-mga akien-mga merged commit 45d627a into godotengine:master Dec 8, 2020
@akien-mga
Copy link
Member

Thanks!

@thebestnom thebestnom deleted the captured-mouse-android-support branch December 8, 2020 21:06
@thebestnom
Copy link
Contributor Author

@m4gr3d Oh no, I missed a horrible mistake, opening a new PR now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants