Page 1 of 1

iPhone Screen Tap

PostPosted: Mar 4, 2010 @ 9:09pm
by la
How do you detect a screen tap and its position?

All I can get is OnStylusMove which only detects movement.

PostPosted: Mar 8, 2010 @ 5:25pm
by fella
Hello la.

With th eedge lib you can
- detect a press event use ClassMain::OnStylusDown(POINT pnt)
- detect a release event use ClassMain::OnStylusUp(POINT pnt)
- detect a move event use ClassMain::OnStylusMove(POINT pnt)

So to detect a tap event you have to :
- Catch the press event and set an internal flag (like press = true)
- Invalidate this flag if a move event is catched
- Wait for a release event
- If a release event is catched and your flag is on, compare the positions and set your flag to false. If the press position is near the release position you have detected a tapp ! :wink:

You can also use Edge timers (ClassERTimer) to add a time-out manager in order to ignore long press.

Good luck.

PostPosted: Mar 12, 2010 @ 7:17pm
by edge