Then came the first day:
I make a version for Android and it worked cross:
func _unhandled_input(e):
if e.is_echo() || get_state() != S_LIVE || !e.is_pressed():
return
if (e.type == InputEvent.MOUSE_BUTTON && e.button_mask & (BUTTON_LEFT | BUTTON_RIGHT)):
_next_dir()
game.add_score(1)
And I was glad.
Then came the second day:
Then they gathered for IOS and found that it no longer works. Quickly realizing that what he added:
func _unhandled_input(e):
if e.is_echo() || get_state() != S_LIVE || !e.is_pressed():
return
if e.type == InputEvent.SCREEN_TOUCH || (e.type == InputEvent.MOUSE_BUTTON && e.button_mask & (BUTTON_LEFT | BUTTON_RIGHT)):
_next_dir()
game.add_score(1)
And on IOS earned. And the sun was shining brightly and the sky was cloudless
Then came the third day:
He returned to the version on the android. He discovered that no longer work. I check all. All all right but still does not work. I began to look and found that the source android getting press on the screen at first sends the press as an event from the mouse and then once already as an event of touch. Because of this action in the script worked twice in a row (the second takes away the first), and I do not what happened.
Attention to the question: why it was done? No need to be combined into one 2 very different events. Well, or at least while on other platforms to make the same behavior.
What I am proposing. It is necessary to divide the mouse event and touch. This must be done either by default or the ability to control it in the settings of the project through what may be the key.
It's a feature, makes it easy to port code to mobile. Not every app/game
needs multitouch.
On Thu, Jun 9, 2016 at 5:04 AM, ret80 [email protected] wrote:
What I am proposing. It is necessary to divide the mouse event and touch.
This must be done either by default or the ability to control it in the
settings of the project through what may be the key.—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/godotengine/godot/issues/5113#issuecomment-224826583,
or mute the thread
https://github.com/notifications/unsubscribe/AF-Z2-c7PLN_PwkRpafCwgJLCqOFknyeks5qJ8kCgaJpZM4IxgVt
.
Let. Then I offer to make this feature a controlled (on / off). And let everyone decides it needs it or not. Regarding easy porting to mobile phones: it is not so because under iOS still need to handle the touch and messages from the mouse does not come there. Because this does not make sense in the monotony of the chips there.
Not many complained about this, but it makes sense, so feel free to make a PR for this
Doing this will of course disable GUI completely, which relies on input events
I'd like to help on this but I'm not sure I'm getting the point.
Is the issue that touch events on Android are being reported twice, once as a touch event and once as a mouse event?
And is that happening only on Android (not iOS)?
It's not a bug, It's a feature
On Jun 23, 2016 1:44 AM, "Pedro J. Estébanez" [email protected]
wrote:
I'd like to help on this but I'm not sure I'm getting the point.
Is the issue that touch events on Android are being reported twice, once
as a touch event and once as a mouse event?And is that happening only on Android (not iOS)?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/godotengine/godot/issues/5113#issuecomment-227948527,
or mute the thread
https://github.com/notifications/unsubscribe/AF-Z27KhuLJZJorInQjnrwNKDqYgHeQTks5qOg8YgaJpZM4IxgVt
.
@RandomShaper, @reduz - Yes, it is true. It is not clear what are the advantages of this opportunity. Required to make it as an option in the project settings. When you enable this option, double messages will be sent not only on Android but also on other platforms with the touch-screen.
I clarified some what details. About the fact that the IOS does not come double messages: the update number 25 they are (maybe they used to be, not sure already). Here are just a mask they always zero. while for smooth Android unit.
What is the actual problem:
In my game for that to start playing you need to click at any space where there are no buttons. But Android and all other systems in addition to IOS I processed the message from the mouse and watched the mask (you can not do this). And there's a mask was always greater than zero. The IOS mask is zero (I did not know about it) and I had to do a background check on the tach. Unfortunately touch comes in any case, even if we pressed the button. And my game is launched. Which was not true behaviors.
Bottom line: it seems that somewhere impaired message processing logic.
Pretty bump, was there any change on master or 2.1/HEAD since?
It's a feature, makes it easy to port code to mobile.
... and its feature im using and enjoing.
This way one can rapidly design/debug android game on PC using mouse.
and when deploing to target android platform - it just works.
If it will get changed, designing android game might turn from easy and fun to annoing and time consuming, because each test run will require sending everything to real device which takes time.
If someone run his code for test every fiew lines, you can imagine what a torment it could be.
No torture with debugging android you will not. A thoughtful problem.
It is necessary to do what would the mouse clicks come as mouse clicks and not converted into a touch (I do not remember how it's done already).
And clicking on the screen was not converted into messages from the mouse.
If you need something that would be clicked on the screen as clicking on the left mouse button, you can add an option to the settings that includes this feature. But by default, it should be turned off.
On ios and android there must be a uniform behavior. Now this is not so.
How does the 'emulate touchscreen' setting interact with this?
In my game I'm getting double events when running from the editor, something somehow expected, but it's happening the same on Android (iOS not tested).
And it's weird because I thought (and it looks as I was right by looking at the code) that such setting has no effect on OS's typically featuring a touchscreen.
Anyway, I think every platform should behave the same, as much as possible.
(Regarding the iOS vs. Android disparity.)
El 10 abr. 2017 5:02 p. m., "ret80" notifications@github.com escribió:
No torture with debugging android you will not. A thoughtful problem.
It is necessary to do what would the mouse clicks come as mouse clicks and
not converted into a touch (I do not remember how it's done already).
And clicking on the screen was not converted into messages from the mouse.
If you need something that would be clicked on the screen as clicking on
the left mouse button, you can add an option to the settings that includes
this feature. But by default, it should be turned off.
On ios and android there must be a uniform behavior. Now this is not so.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/godotengine/godot/issues/5113#issuecomment-292976748,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ALQCtpw-uzaEZx2IYoVLRzbQbT1srdoJks5rukRygaJpZM4IxgVt
.
First of all thank you for your report and sorry for the delay.
We released Godot 3.0 in January 2018 after 18 months of work, fixing many old issues either directly, or by obsoleting/replacing the features they were referring to.
We still have hundreds of issues whose relevance/reproducibility needs to be checked against the current stable version, and that's where you can help us.
Could you check if the issue that you described initially is still relevant/reproducible in Godot 3.0 or any newer version, and comment about it here?
For bug reports, please also make sure that the issue contains detailed steps to reproduce the bug and, if possible, a zipped project that can be used to reproduce it right away. This greatly speeds up debugging and bugfixing tasks for our contributors.
Our Bugsquad will review this issue more in-depth in 15 days, and potentially close it if its relevance could not be confirmed.
Thanks in advance.
Note: This message is being copy-pasted to many "stale" issues (90+ days without activity). It might happen that it is not meaningful for this specific issue or appears oblivious of the issue's context, if so please comment to notify the Bugsquad about it.
As there was no answer to the above request, we're closing this issue as inactive.
If you can still reproduce it, please open a new issue against a currently supported release of Godot.