Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Touch delay in iOS near left of the screen
Started by ivansolispadilla Dec 08 2019 03:50 PM

No replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

ivansolispadilla

[GLOBAL: userInfoPane.html]
ivansolispadilla
  • Observer

  • 5 posts
  • Corona SDK

I created a "tap and hold" using a timer. I noticed the hold time seems a lot longer if touch is close to the left edge of the screen in portrait. Debugging I see that the touch 'began' is not received at all until a few milliseconds later. Or from another perspective: the time from 'began' to the timer callback is the correct time. So I am sure my logic is correct and what happens is the first touch 'began' is delayed.

 

Digging a bit found that apparently this is a known odd behavior on iOS,  and the recommendation is to set delaysTouchesBegan to false according to a couple of stack overflow posts I am linking below.

 

Is there a plan to add this delaysTouchesBegan to Corona? Or, is there a known workaround besides blocking the edge of the screen from the user?

 

A single tap seems to work fine. I guess once some gesture recognizer in iOS finds that it will do nothing with the touch event; the event is forwarded to the rest of the app and can be handled normally. So this is only an issue for my "tap and hold" logic.

 

This is important because trying to go fast with a mix of taps and tap and holds one tends to learn the timing and not wait more than necessary. So a tap and hold with the expected timing becomes a tap from the Lua code perspective and the user loses the game.

 

https://stackoverflow.com/questions/33619595/touch-events-are-delayed-near-left-screen-edge-on-ios-9-only-how-to-fix-it

 

https://stackoverflow.com/questions/39813245/touchesbeganwithevent-is-delayed-at-left-edge-of-screen?rq=1

 

 




[topic_controls]
[/topic_controls]