Skip to content

Instantly share code, notes, and snippets.

@pgaskin
Last active August 13, 2022 12:18
Show Gist options
  • Save pgaskin/fd5a662d4fc6b2f3ac667f3d6a5fa638 to your computer and use it in GitHub Desktop.
Save pgaskin/fd5a662d4fc6b2f3ac667f3d6a5fa638 to your computer and use it in GitHub Desktop.
Observations about touch gesture behavior in the RealVNC app.

One finger drag

  • ignore until moved a few pixels
  • iff one finger is down (ignore events otherwise without changing state), cancel any fling or pending tap (only cancel the tap if it's before the initial release) and do mouse cursor move
  • fling based on final velocity
  • cancel fling on move (not necessarily on finger down)
  • relative to device dpi, not real local or remote screen

Two finger drag (when not in the middle of a tap gesture, but can cancel it if still before the first stage finger up)

  • ignore until a threshold is reached for a gesture below, then cancel any fling or pending tap (only cancel the tap if it's before the initial release)
  • vertical scroll
  • horizontal scroll
  • zoom (unless in the middle of a scroll) (simple: simply sets scale factor while attempting to preserve the center position of the last step)

Tap

  • on finger up, click after 30ms (right if double, middle if triple)
  • if finger down (any finger anywhere on screen), cancel timer and send mouse down
  • ignore future fingers until end
  • on release of last finger on screen, send mouse up, and send another click immediately after if the position is the same as the first click
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment