Single touch events

I thought that the lack of a began touch event in certain situations on the Android simulator was an error, but it seems that it happens on the device as well.

Is this correct or is there something else required to detect touch events on Android?

matt [import]uid: 8271 topic_id: 9035 reply_id: 309035[/import]

Hi,

the simulator isn’t hardware specific, only the skin and resolution reassembles a certain platform. And on the IOs platform I never noticed something like this.

I think it has something to do with your code. Can you post it or a small example that illustrates the issue you have?

Cheers
Michael Hartlef

http://www.whiteskygames.com http://www.twitter.com/mhartlef [import]uid: 5712 topic_id: 9035 reply_id: 32932[/import]

Something as simple as:

[lua]function touch( event )
print(event.phase)
end

Runtime:addEventListener( “touch”, touch )[/lua]

Should output something different on the Windows Simulator and Android device than it does on the Mac iOS simulator and iPhone/Pad.

The missing phase is “began”, but not always - hence the problem.

matt [import]uid: 8271 topic_id: 9035 reply_id: 32933[/import]

Which version of corona? I’ve never seen that before - although I’ve never checked - I’ve never had a problem in game.

Not ideal, but you could work around it for now by testing event == began and a flag which you can set on the first moved event. [import]uid: 8872 topic_id: 9035 reply_id: 32939[/import]

Ok, now you are more specific. If I understood correctly, you say that the windows simulator behaves different than the OSX simulator. On Android device I didn’t notice this behaviour and I use that touch eventlister extensively. Will watch if I noticed anything. [import]uid: 5712 topic_id: 9035 reply_id: 32960[/import]

Yep - just tried on the Mac simulator on all the simulated devices and no problems. Definitely present on the Windows simulator and an Android device (not mine, can’t remember which one, I’m afraid) though that binary was build on a Mac.

m [import]uid: 8271 topic_id: 9035 reply_id: 32973[/import]

Sorry it’s been a while, busy week, but I’ve got my pc running the same code as before and the Droid simulator.

Code:
[lua]function touch( event )
print( event.id, event.name, event.phase, event.time )
end

Runtime:addEventListener( “touch”, touch )[/lua]

Output without move events, just taps…

One tap only:
[lua]Copyright © 2009-2010 A n s c a , I n c .
Version: 2.0.0
Build: 2011.484
userdata: 0051A988 touch began 437
userdata: 0051A988 touch ended 500[/lua]

Double tap:
[lua]Copyright © 2009-2010 A n s c a , I n c .
Version: 2.0.0
Build: 2011.484
userdata: 0051A98C touch began 422
userdata: 0051A98C touch ended 484
userdata: 0051A990 touch ended 656[/lua]

Triple tap:
[lua]Copyright © 2009-2010 A n s c a , I n c .
Version: 2.0.0
Build: 2011.484
userdata: 0051A994 touch began 469
userdata: 0051A994 touch ended 516
userdata: 0051A998 touch ended 688
userdata: 0051A99C touch began 797
userdata: 0051A99C touch ended 875[/lua]

Obviously, what is happening here is that the began event on a double tap is missing. The triple tap experiences the double tap problem, then the third is fine.

I have observed the same behaviour on all the simulated devices and, as you can see, this is running on the current version 484.

The problem, at least for me, is that I’ve written a library which uses the touch event to count taps, so that I can have different tap speeds, count more than the apparent limit of 3 taps and other, multitouch events, like patterns. This doesn’t work if the began and ended events do not match up.

Matt. [import]uid: 8271 topic_id: 9035 reply_id: 33226[/import]

We’ve seen some reports of missing “began” events on Touch and now able to reproduce it on iOS devices and the Windows Simulator. This may also apply to Tap events too. This problem seems to be in our core code so it will apply to all platforms.

We are looking into the issue and hope to have a fix soon in our Daily Builds. [import]uid: 7559 topic_id: 9035 reply_id: 34111[/import]

Good to hear on this - it’s causing a major issue and pretty much breaks the iOS/Android code base.
It would be great not to have to cater for this in the touch library I’m building.

Thanks Tom,

M [import]uid: 8271 topic_id: 9035 reply_id: 34222[/import]