double-tap / single-tap

Is there a way to make openframeworks for iPhone only report a double-tap and not report the first tap also as a single-tap?

Do you mean two fingers touching or an actual double tap (one finger presses, releases quickly then presses again like a pc mouse double click)? If you mean detect two fingers down, you can look for a touch ID of 1, that’ll be the second finger. You’ll probably wanna store the coordinates of the first finger to do any kinda gesture

-Steve

If you’re looking for a double tap, rather than 2 finger tap, look for an initial tap of ID 0 (I think), capture the time, and if you receive another tap of ID 0 in (lets say) 500ms of the last tap that’ll be your double tap.

The oF iPhone ImagePicker demo has good examples of single and double finger tap - http://github.com/openframeworks/openFr-…-testApp.mm

— edit —

Hey - looking at that code there is actually a touchDoubleTap method - maybe that’s what you’re after?

Is there a way to make openframeworks for iPhone only report a double-tap and not report the first tap also as a single-tap?

unfortunately there is no simple command to do this. The first tap is sent as soon as it is detected, at that point the iphone doesn’t know that a new tap is coming and it’s going to be a double-tap. The way to do what you want, is whenever you get a tap, to wait xx milliseconds, if another tap has come in that time (and in the same vicinity) do the double-tap and don’t do a single-tap, otherwise do the single-tap. We don’t do this in OF-core because it would introduce a delay to the single-tap (by the xx milliseconds). You can do this in testApp quite easily though.