Giter Club home page Giter Club logo

Comments (32)

akien-mga avatar akien-mga commented on September 17, 2024 2

Thanks both for debugging this thoroughly!

from godot.

Alex2782 avatar Alex2782 commented on September 17, 2024 2

If at some point more users should have problems, then we could perhaps also increase the default value for Android.

https://github.com/search?q=repo%3Agodotengine%2Fgodot+scroll_deadzone&type=code

from godot.

daveTheOldCoder avatar daveTheOldCoder commented on September 17, 2024 2

I tested android_debug_base_button.apk with Godot 4.3-stable, using the project on which I originally opened this issue.

I tested Android exports on a Samsung Galaxy S9 (O/S Android 10) and a Google Pixel 8 (O/S Android 14).

I tested with scroll_deadzone values of 0 and 3.

There were no problems. The buttons and checkboxes worked correctly in all cases.

from godot.

daveTheOldCoder avatar daveTheOldCoder commented on September 17, 2024 1

Yes, it still occurs in 4.3.rc2.

I've been able to work around it for Button's by using the button_up signal instead of the pressed signal. I haven't yet figured out a work-around for CheckBox's.

I'd like to help find the cause, but I don't know where to start. If you can suggest an area of the Godot engine source code to look at, I could try adding some debug code there to help isolate the problem.

from godot.

akien-mga avatar akien-mga commented on September 17, 2024 1

I tested the MRP on a Pixel 7a with 4.3.rc2 and couldn't reproduce the issue sadly.

From the changes in 4.3-beta1 where you report the regression starting, I mostly notice this PR which sounds related:

If you can build Godot from source, I would suggest trying to build from the latest master branch with that PR reverted locally to see if that solves the issue on your more complex reproduction project.

CC @Alex2782 @m4gr3d

from godot.

Alex2782 avatar Alex2782 commented on September 17, 2024 1

After 10 minutes of testing I could not reproduce it yet.

I have extended the info function to visually separate the event output:

func info(signal_name: String) -> void:
	if (signal_name == "button_down"): print("-------------------------------")
	print("%s/%s/%s" % [name, signal_name, "is pressed" if button_pressed else "is not pressed"])

adb logcat -s godot

On Android always 4 events (CheckBox) as in the editor with pressed and toggled events:

logcat
08-08 12:03:48.483 13232 13336 I godot   : CheckBox2/button_down/is pressed
08-08 12:03:48.515 13232 13336 I godot   : CheckBox2/toggled off/is not pressed
08-08 12:03:48.515 13232 13336 I godot   : CheckBox2/pressed/is not pressed
08-08 12:03:48.515 13232 13336 I godot   : CheckBox2/button_up/is not pressed
08-08 12:03:49.116 13232 13336 I godot   : -------------------------------
08-08 12:03:49.116 13232 13336 I godot   : CheckBox2/button_down/is not pressed
08-08 12:03:49.181 13232 13336 I godot   : CheckBox2/toggled on/is pressed
08-08 12:03:49.181 13232 13336 I godot   : CheckBox2/pressed/is pressed
08-08 12:03:49.181 13232 13336 I godot   : CheckBox2/button_up/is pressed
08-08 12:03:49.269 13232 13336 I godot   : -------------------------------
08-08 12:03:49.269 13232 13336 I godot   : CheckBox2/button_down/is pressed
08-08 12:03:49.339 13232 13336 I godot   : CheckBox2/toggled off/is not pressed
08-08 12:03:49.339 13232 13336 I godot   : CheckBox2/pressed/is not pressed
08-08 12:03:49.339 13232 13336 I godot   : CheckBox2/button_up/is not pressed
08-08 12:03:49.430 13232 13336 I godot   : -------------------------------
08-08 12:03:49.430 13232 13336 I godot   : CheckBox2/button_down/is not pressed
08-08 12:03:49.497 13232 13336 I godot   : CheckBox2/toggled on/is pressed
08-08 12:03:49.497 13232 13336 I godot   : CheckBox2/pressed/is pressed
08-08 12:03:49.497 13232 13336 I godot   : CheckBox2/button_up/is pressed
08-08 12:03:49.572 13232 13336 I godot   : -------------------------------
08-08 12:03:49.573 13232 13336 I godot   : CheckBox2/button_down/is pressed
08-08 12:03:49.644 13232 13336 I godot   : CheckBox2/toggled off/is not pressed
08-08 12:03:49.644 13232 13336 I godot   : CheckBox2/pressed/is not pressed
08-08 12:03:49.644 13232 13336 I godot   : CheckBox2/button_up/is not pressed
08-08 12:03:49.714 13232 13336 I godot   : -------------------------------
08-08 12:03:49.714 13232 13336 I godot   : CheckBox2/button_down/is not pressed
08-08 12:03:49.781 13232 13336 I godot   : CheckBox2/toggled on/is pressed
08-08 12:03:49.782 13232 13336 I godot   : CheckBox2/pressed/is pressed
08-08 12:03:49.782 13232 13336 I godot   : CheckBox2/button_up/is pressed
08-08 12:03:49.850 13232 13336 I godot   : -------------------------------
08-08 12:03:49.850 13232 13336 I godot   : CheckBox2/button_down/is pressed
08-08 12:03:49.922 13232 13336 I godot   : CheckBox2/toggled off/is not pressed
08-08 12:03:49.923 13232 13336 I godot   : CheckBox2/pressed/is not pressed
08-08 12:03:49.923 13232 13336 I godot   : CheckBox2/button_up/is not pressed
08-08 12:03:50.007 13232 13336 I godot   : -------------------------------
08-08 12:03:50.007 13232 13336 I godot   : CheckBox2/button_down/is not pressed
08-08 12:03:50.081 13232 13336 I godot   : CheckBox2/toggled on/is pressed
08-08 12:03:50.081 13232 13336 I godot   : CheckBox2/pressed/is pressed
08-08 12:03:50.081 13232 13336 I godot   : CheckBox2/button_up/is pressed
08-08 12:03:50.141 13232 13336 I godot   : -------------------------------
08-08 12:03:50.141 13232 13336 I godot   : CheckBox2/button_down/is pressed
08-08 12:03:50.226 13232 13336 I godot   : CheckBox2/toggled off/is not pressed
08-08 12:03:50.226 13232 13336 I godot   : CheckBox2/pressed/is not pressed
08-08 12:03:50.226 13232 13336 I godot   : CheckBox2/button_up/is not pressed
08-08 12:03:50.249 13232 13336 I godot   : -------------------------------
08-08 12:03:50.249 13232 13336 I godot   : CheckBox2/button_down/is not pressed
08-08 12:03:50.306 13232 13336 I godot   : CheckBox2/toggled on/is pressed
08-08 12:03:50.306 13232 13336 I godot   : CheckBox2/pressed/is pressed
08-08 12:03:50.306 13232 13336 I godot   : CheckBox2/button_up/is pressed

image

from godot.

daveTheOldCoder avatar daveTheOldCoder commented on September 17, 2024 1

How did you do that?

I downloaded the previous version of GodotGestureHandler.kt, and copied it over the new version of the file.

I now see that could fail if there were interdependencies with other files.

Should I use the git revert command to do that? Is this the correct command?
git revert ab9e377fe68b1735f1d30a8cdd83f518c7091925

If I try that, I get a merge conflict:

$ git revert ab9e377
Auto-merging platform/android/java/lib/src/org/godotengine/godot/input/GodotGestureHandler.kt
CONFLICT (content): Merge conflict in platform/android/java/lib/src/org/godotengine/godot/input/GodotGestureHandler.kt
error: could not revert ab9e377... Fix InputEventScreenDrag on Android
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git revert --continue".
hint: You can instead skip this commit with "git revert --skip".
hint: To abort and get back to the state before "git revert",
hint: run "git revert --abort".
hint: Disable this message with "git config advice.mergeConflict false"

Or would it be better to use git checkout?

from godot.

daveTheOldCoder avatar daveTheOldCoder commented on September 17, 2024 1

I have tested MRP again and could not find any issues / regression.

That MRP is not very good. I can try to improve it, but suggestions would be helpful. Maybe I should try using a larger piece of the original project.

from godot.

daveTheOldCoder avatar daveTheOldCoder commented on September 17, 2024 1

I've made a copy of the original project, and am removing as much as I can from it, without changing the issue symptoms.

I'll post it here when I'm finished, which may take a day or so. I'll include instructions on using it.

from godot.

daveTheOldCoder avatar daveTheOldCoder commented on September 17, 2024 1

Here's the new MRP. It's not really "minimal", but it's much smaller than the original project.

The project folder includes a README file with instructions.

Please let me know if you have any questions.

(I removed the link, since the issue is solved.)

from godot.

daveTheOldCoder avatar daveTheOldCoder commented on September 17, 2024 1

The list can also be scrolled "slightly" horizontally if you do not touch the display cleanly and swipe, then the "drag" event is executed earlier because of PR #84331 (i think)

THAT WAS IT!

If I set the ScrollContainer's Scroll Deadzone property to 10 (it was 0), the problem does not occur. 😀

I confirmed this in both the MRP and the original project.

from godot.

daveTheOldCoder avatar daveTheOldCoder commented on September 17, 2024 1

Do you mean use the Android template android_debug_base_button.apk linked there with Godot 4.3-stable? Okay, I'll do that within the next few days.

from godot.

Alex2782 avatar Alex2782 commented on September 17, 2024 1

yes please with scroll_deadzone between 0 and 3

from godot.

akien-mga avatar akien-mga commented on September 17, 2024

Can you still reproduce this issue in 4.3.rc2 or later?

from godot.

Alex2782 avatar Alex2782 commented on September 17, 2024

Maybe now? video see below
drag issue / regression ? sometimes without pressed and toggled events

I could imagine that on some low devices with poor touch displays, normal 'touch' events could be interpreted as 'drag' events.

08-08 12:24:01.697 13232 13336 I godot   : -------------------------------
08-08 12:24:01.697 13232 13336 I godot   : CheckBox2/button_down/is not pressed
08-08 12:24:03.796 13232 13336 I godot   : CheckBox2/button_up/is not pressed
08-08 12:24:09.339 13232 13336 I godot   : -------------------------------
08-08 12:27:05.835 13232 13336 I godot   : Button2/button_down/is pressed
08-08 12:27:08.052 13232 13336 I godot   : Button2/button_up/is not pressed
08-08 12:27:09.109 13232 13336 I godot   : -------------------------------
test.mp4

from godot.

daveTheOldCoder avatar daveTheOldCoder commented on September 17, 2024

normal 'touch' events could be interpreted as 'drag' events

That's interesting.

I haven't had time to investigate all the information in the recent replies yet. But in my original complex project, the problematic controls were inside draggable panels. When I changed the BaseButton action_mode property from ACTION_MODE_BUTTON_RELEASE to ACTION_MODE_BUTTON_PRESS. and then touched a problematic control, the panel started moving as if I were dragging it. A complication there is that I was using the ReorderableContainer add-on from the Asset library. The issue reported here also occurs in a place where that add-on is not used.

from godot.

Alex2782 avatar Alex2782 commented on September 17, 2024

PR #84331 there is no longer a threshold value for when a drag event starts. (src)

Here is the official Android API for comparison:

androidx.core sources

image
image

I'll try to find time next week to find solutions for this. I think it should work like mouse drag events. If I hold the left mouse button and move the mouse pointer like in the video, the pressed events are still triggered when I release the mouse pointer inside the button.

from godot.

daveTheOldCoder avatar daveTheOldCoder commented on September 17, 2024

If you can build Godot from source, I would suggest trying to build from the latest master branch with that PR reverted locally to see if that solves the issue on your more complex reproduction project.

I haven't build Godot recently, although I keep a local copy of the repository up to date. I'll try your suggestion, but it may take some time for me to re-learn how to do that.

from godot.

daveTheOldCoder avatar daveTheOldCoder commented on September 17, 2024

If you can build Godot from source, I would suggest trying to build from the latest master branch with that PR reverted locally to see if that solves the issue on your more complex reproduction project.

I rebuilt the engine from the latest master branch commit 739019e, manually reverting that PR's changed file to the previous version https://github.com/Alex2782/godot/blob/e04a38775b45d25155d7658d3914d4eef2b9fd42/platform/android/java/lib/src/org/godotengine/godot/input/GodotGestureHandler.kt

That did not fix the issue in the Android export.

I used the official prebuilt 4.3-rc3 export templates. Do they need to be rebuilt? I tried to rebuild them, but got errors.

from godot.

Alex2782 avatar Alex2782 commented on September 17, 2024

docs

  1. scons platform=android target=template_debug arch=arm64
  2. cd ./platform/android/java
  3. ./gradlew generateGodotTemplates
  4. use Custom Template, with V4.3-rc2 or V4.3-rc3 Editor
    image

from godot.

daveTheOldCoder avatar daveTheOldCoder commented on September 17, 2024

Alex2782:

Do I need to build custom Android templates after manually reverting your PR?

I tried, but the gradlew command gave me errors that I don't understand:
build_template_gradlew.log.zip

from godot.

Alex2782 avatar Alex2782 commented on September 17, 2024

@daveTheOldCoder

after manually reverting your PR

How did you do that? A function is not found: handleMotionEvent, file: GodotGestureHandler.kt

> Task :lib:compileTemplateDebugKotlin FAILED
e: file:///home/dave/github/godot/platform/android/java/lib/src/org/godotengine/godot/input/GodotGestureHandler.kt:65:21 Unresolved reference: handleMotionEvent

Do I need to build custom Android

Yes, if you want to test the projects on Android (APK Export or Remote Debug). I use the normal Editor, last versions 'rc', 'beta' or 'dev' extra compiling the editor should not be necessary.

from godot.

Alex2782 avatar Alex2782 commented on September 17, 2024

please try: https://github.com/Alex2782/godot/tree/master_without_pr_84331

compare

details / how to

I'm no Git guru, but revert seems to be the right solution. After that I solved all conflicts with VS Code.

screenshot: VS Code

image

But it was not enough, I had to change one line.
(I used Android Studio to find the error Unresolved reference: handleMotionEvent.)

from:
Bildschirmfoto 2024-08-09 um 18 04 48

to:
image


Update: I have tested MRP again and could not find any issues / regression. Yesterday I probably tested incorrectly and didn't check exactly where I released my finger.

from godot.

daveTheOldCoder avatar daveTheOldCoder commented on September 17, 2024

Okay, I'll try that next.

Right now, I've checked out the parent of your PR's commit, and am building the Android templates from that:
git checkout 40b4130

screenshot

from godot.

daveTheOldCoder avatar daveTheOldCoder commented on September 17, 2024

git checkout 40b4130

Using the Android templates built from that, the problem I reported in the original post does not occur.
To export to Android, I used Godot editor v4.3.rc3.official [03afb92] and the custom Android templates.

master_without_pr_84331

Would it help if I tried that too?

from godot.

Alex2782 avatar Alex2782 commented on September 17, 2024

Maybe I should try using a larger piece of the original project.

It would be no problem for me to use the original project. It is sufficient if the project navigates directly to the scene where the issues occur at startup. Perhaps a short video on how to test it would also be helpful.

from godot.

Alex2782 avatar Alex2782 commented on September 17, 2024

3b. The Cleaning Log page displays a scrolling list of panels. Each panel has a checkbox labeled Delete. Touching a checkbox should toggle it between the checked and unchecked states. But in an Android export, the checkboxes do not respond to touches.

v4.3.rc2.official [3978628c6]

Test: https://youtu.be/dLyGqLA8avk on Samsung Tab S7 (11" Display)

I am not sure if I have tested it correctly. The list can also be scrolled "slightly" horizontally if you do not touch the display cleanly and swipe, then the "drag" event is executed earlier because of PR #84331 (i think)

Out of approx. 100 touches, the checkboxes were not switched a maximum of 3 times, and you also have to wait approx. 500 milliseconds after each touch.

from godot.

daveTheOldCoder avatar daveTheOldCoder commented on September 17, 2024

Did you test the next item (3c. The Edit Profile page...)?

Do you have any idea why I get different results on my Samsung Galaxy S9? And why the problem occurs only when the PR is applied?

from godot.

Alex2782 avatar Alex2782 commented on September 17, 2024

I have now also tried it on my Pixel 4a (5" display) without Scroll Deadzone, it also works well (3b and 3c). It is only smaller and harder to hit the checkboxes.

I didn't know Scroll Deadzone until now, there already seems to be a configuration option, can this issue report be closed?

PR #84331 bypasses the "natural" deadzone in the Android API "onScroll" event.
So that gaming controls work better: comment from issue #84138

I'm attempting to have fine control of a screen element on mobile using touch. Specifically for controlling a pick in a lock picking mini-game. Current testing is on Android.

But regardless of the input methods I've tried after pressing on the pick there is no motion until the pick suddenly catches up with the touch once it has moved 20+ pixels from the starting location.

from godot.

daveTheOldCoder avatar daveTheOldCoder commented on September 17, 2024

can this issue report be closed?

If you're asking me, it can be closed as far as I'm concerned.

from godot.

daveTheOldCoder avatar daveTheOldCoder commented on September 17, 2024

I'll just note that although I'm satisfied with this solution, it's the first time I've needed to use a non-default value for a ScrollContainer deadzone. Other users might run into this same issue.

from godot.

Alex2782 avatar Alex2782 commented on September 17, 2024

@daveTheOldCoder
If you find time please try #95532 (comment) with your productive projects.

from godot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.