BaseButton: multitouch support#110893
Conversation
BaseButton: multitouch support
Something like this should be at the beginning of godot/scene/2d/physics/touch_screen_button.cpp Lines 140 to 142 in ecfe34f This should also be done where input is processed, so that input is skipped if the button is invisible because the user doesn't have a touchscreen currently. |
Thanks for the instructions. Added the boolean touchscreen_only. |
|
You've accidentally merged the master branch into your branch incorrectly taking ownership over the changes, to prevent this make sure you rebase to update your branch, to fix this you need to remove the merge commit with master and rebase instead, see here |
71ead7f to
885808d
Compare
|
Is it now fixed? |
Alex2782
left a comment
There was a problem hiding this comment.
I tested it on Android and didn't find any critical regressions. We can still optimize some minor things in the code.
Hover test, VideoScreen_recording_20260324_041445.mp4I believe the following bug fix is needed to solve it properly. Only after that is it possible to receive if (!over) {
over = gui_find_control(pos);
}here in the It still needs to be checked whether this change leads to regressions. What also doesn't work yet is the multitouch hover effect; a maximum of 1 button changes the hover status.
|
|
Do we even want to have a hovering for touch input, since hovering is technically not possible with a touch input. |
|
I agree that it makes little sense to give touches a hovering state. |
03d76c2 to
fffa9f0
Compare
|
I just want to offer a rebuttal that there are touch inputs that support hovering. For example, I plan to use multitouch support for XR finger input, and in XR you have full 6 degree of freedom information about the finger locations at all times when using hand tracking. Also, tablets with a pen and stylus often show the hover location of the stylus. it's not multi-touch, but it is a form of touch input. I'm not here to block this on hover support for touch input, just trying to make a case that there are applications (such as my VR framework) that may have a use for hover. |
|
Maybe we could add hovering for touch input in a follow up pull request. Currently i don't have a device to test it. |
Alex2782
left a comment
There was a problem hiding this comment.
Retested on Android: Touch input and Bluetooth mouse.
No critical regressions detected, this PR behaves like version 4.6-official (with input emulation enabled).
I believe a lot more work is needed before proposal #3976 can be closed / before TouchScreenButton can be marked as deprecated.
m4gr3d
left a comment
There was a problem hiding this comment.
The code looks good and I wasn't able to detect any regressions from a quick round of testing, so the PR looks good to go!
|
@Kazox61 Can you squash the commits. |
d961128 to
7be8ea9
Compare
7be8ea9 to
13b347b
Compare
|
Thanks! |
|
Awesome! |

ClosesPartially implements godotengine/godot-proposals#3976I added support for multitouch by using screen events instead of mouse events when touch screen is available.
I couldn't figure out how this boolean should work.
Do we want to have a hover if the touch started outside and dragged inside the button?