Sunday, June 28, 2009

Multitouch start and end events

I just found out that it's not always the case that you may get the multitouch start and end events, i.e. you can get a multitouch move without a multitouch start. Or you could lift off your fingers but not get a multitouch end event. You have to precisely lift off together your fingers to get a multitouch end event. So it's difficult to know whether the user has two fingers or just one on the screen, because he could have two finger on the screen, but only moving one finger, so you would get a single touch event.

This is very annoying. I want to do an in-game quick editor where you can pinch to zoom in/out with two fingers and drag with one finger. However I haven't figured out how to do it properly because of the issue described above. So far I have set a flag to true whenever a multitouch start/move is detected and turned the flag off on the end event. So when this flag is on, I cannot do dragging. However, the user would need to do a proper lift off of his two fingers to trigger a multitouch end event. Will leave it as it is for now, unless I get another idea how to solve the issue.

No comments: