Godot version:
3.0.6
OS/device including version:
windows 10 pro / GT 1030 gpu
Issue description:
In the script extending button, when using _gui_input() and InputEventScreenTouch, it does not cause the button to be pressed down. Visually also the button does not go button_down.
Steps to reproduce:
Create a button, and in the code do:
func _gui_input():
if event is InputEventScreenTouch and event.is_pressed():
self.pressed = true
// Also if you connect the pressed() signal with this button, it will not trigger the signal when self.pressed = true. Visually the button does not go down and it does not trigger the Pressed() signal. HOWEVER, IF THE BUTTON IS SET TO TOGGLE MODE, IT WILL REGISTER THE BUTTON AS PRESSED CORRECTLY
Minimal reproduction project:
InputEventScreenTouch Bug.zip
maybe you pressed "Submit new issue" button before completing to upload your sample project.
maybe you pressed "Submit new issue" button before completing to upload your sample project.
Sorry. I can try to upload again. However, keep in mind that this is for android export. If you try this project, you will have to make sure your the editor settings for export are correct and also the export settings.
However, if you have a computer touch screen you could also try it that way.
There is a option Emulate Touchscreen at Project Settings > Display > Window > Handheld to test touches on PC.
doesn't it help to test on PC?
There is a option
Emulate Touchscreenat Project Settings > Display > Window > Handheld to test touches on PC.
doesn't it help to test on PC?
Yes. You're right. However, I do not consider that a reliable way to test your input, because although it's emulating a touch, there are slight discrepancies which could affect the behavior. For example, after pressing and holding your finger down, if you move it at all, godot interprets that as a release, I think. It's behaving very strangely and I can't get it to work.
yes. it does not guarantee to work exact same with touches, but helps while developing.
so, your issue occurs on the actual phone, not on the PC?
yes. it does not guarantee to work exact same with touches, but helps while developing.
so, your issue occurs on the actual phone, not on the PC?
The issue occurs on my phone. It appears to work fine on my PC with emulate touchscreen on.
When I'm pressing and holding down on the screen with my phone, it does not constantly register "event.is_pressed()"
I do not suspect the problem is with my phone. I am able to press and hold all other things just fine, like other apps and OS items.
the InputEventScreenTouch is occurred once only touch start or end.
when holding down, InputEventScreenDrag event occurs.
if you want to check it, I would suggest you to use a variable to save its state.
var is_touched = false
func _gui_input():
if event is InputEventScreenTouch:
is_touched = event.is_pressed()
does it help?
the
InputEventScreenTouchis occurred once only touch start or end.
when holding down,InputEventScreenDragevent occurs.if you want to check it, I would suggest you to use a variable to save its state.
var is_touched = false func _gui_input(): if event is InputEventScreenTouch: is_touched = event.is_pressed()does it help?
I am not certain how to apply or test that. I'm sorry. I'll keep trying, though.
Yeah, when InputEventScreenDrag event occurs, all other Button can not pressed.
I find this issue in my game, when I touched and drag to fire. I can't change my weapon by click button in the same time.
Can anyone still reproduce this on Godot 3.2 beta4?
@Calinou I am having this issue in Godot 3.2 stable, where the Button isn't working on mobile with emulate touch with mouse, but it works on desktop.
It seems like the reason why this isn't working is because in _gui_input, there isn't a mouse dragged input event to signal for the button to be pressed, but it does receive an InputEventScreenDrag and InputEventScreenTouch
This issue should be redefined as an enhancement to the BaseButton class that lets it also detect the InputEventScreenTouch event in _gui_input
This might be happening due to touch release events not being sent. Similar to #16761, #41585
Most helpful comment
the
InputEventScreenTouchis occurred once only touch start or end.when holding down,
InputEventScreenDragevent occurs.if you want to check it, I would suggest you to use a variable to save its state.
does it help?