This discussion is archived
20931 Views 22 Replies Latest reply: Jul 27, 2010 7:37 AM by cemaleker
Currently Being ModeratedSep 19, 2009 10:50 AM (in response to AndyQua)Hi, having the same issue, yes, touchesEnded sometimes is not called if we tap too fast, but I am working on a solution which works for me:
as we get a UIEvent, we can read the UIEvent.timestamp property (we also get a timestamp on the UITouch reference), and ignore any second touch which goes too fast. We can also try to ignore if there is finally a touchesEnded event, saving an array of references of ignored touches.
Hope it can help anyone.
Jose.MacBook Pro 2.4GHz Intel Core 2 Duo, 2GB RAM, Mac OS X (10.6)
Currently Being ModeratedSep 19, 2009 11:27 AM (in response to AndyQua)if anyone interested, this is a trace I got:
2009-09-19 19:25:13.527 Test4[577:207] touched: 444.000000 271.000000 , count: 1 , timestamp: 1964.198805
2009-09-19 19:25:13.542 Test4[577:207] touched: 25.000000 48.000000 , count: 1 , timestamp: 1964.214908
2009-09-19 19:25:13.591 Test4[577:207] touch ended: 447.000000 268.000000 , count: 1
you can see two touches and only one ended, and the timestamp difference is milliseconds, so to make this work we need to adjust to a low value difference, like 0.1 seconds or something, otherwise we won't be able to use tapCount.
The solutions works for me, so if anyone interested on the code let me know.
PS: by the way, I think it also may happens the other way round, two fast touches may give one touchBegin and two touchesEnd.MacBook Pro 2.4GHz Intel Core 2 Duo, 2GB RAM, Mac OS X (10.6)
Currently Being ModeratedFeb 23, 2010 7:31 PM (in response to AndyQua)One thing which has been a recurring theme with regards to touch input issues in my application has been simply the speed at which the timer callback is monitored.
If this is set too fast for the processing function (ie. by the time I finished processing a callback another one had already triggered) I found it appeared to 'mess' with the input events causing a tailback of them to occur and 'strange' things to happen.
Slowing down the rate at which this is called solved all my issues and might be something worth considering ...MacBook Pro, iPhone OS 3.1
Currently Being ModeratedJul 1, 2010 5:22 AM (in response to gonk)If you run your game/app as a thread, timing the gap between execution times and running your main loop with updates based on the delta time (dt), then you don't drop touches anymore.
Hope that helps.Mac OS X (10.5.3)
Currently Being ModeratedJul 27, 2010 7:37 AM (in response to AndyQua)Here is my solution.
Check touch phase of waiting touches when a new touch began. Discard touches with phase "UITouchPhaseEnded".
It worked for me. Hope this one helps you.
Cemal.Mac OS X (10.6.4)