PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

iPhone Screen Tap

How do you detect a screen tap and its position?

All I can get is OnStylusMove which only detects movement.
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.
Hi,

We recommend using ClassEInput instead. With this you can get click or touch events (they share the same event type): releases, presses and double presses. Use EIC_TOUCH1 to EIC_TOUCH5 to handle multi-touch.