Skip to main content

Module screen_reader_touch

Module screen_reader_touch 

Expand description

Explore by touch: what a finger means while the built-in screen reader is on, as TalkBack and VoiceOver read it.

  • A finger resting or dragging on the screen explores: the item under it is spoken and the reading cursor moves there, and nothing is pressed. Lifting the finger leaves the cursor where it is.
  • A quick tap explores the item under it too, once it is clear no second tap follows.
  • A double tap anywhere activates the item the cursor is on.
  • A quick one-finger swipe right or left moves to the next or previous item.

A second finger ends the gesture: nothing more is read from the contacts until every finger has lifted.

One recognizer for every host. It is pure: the host passes each contact in the window’s logical pixels with its time, arms a timer for TouchExplorer::deadline and calls TouchExplorer::poll when it fires. A finger that has not yet moved past TAP_SLOP is not read until EXPLORE_DELAY has passed, so the start of a swipe or the first tap of a double tap never moves the cursor.

Structs§

TouchExplorer
Reads one-finger touches as the screen reader’s gestures.

Enums§

ExploreGesture
What a finger asked the screen reader for.

Constants§

DOUBLE_TAP_SLOP
How far, in logical pixels, the second tap of a double tap may land from the first.
DOUBLE_TAP_TIMEOUT
The longest wait between a tap’s lift and the second tap’s touch.
EXPLORE_DELAY
How long a resting finger waits before it explores, so a tap or the start of a swipe reads nothing.
SWIPE_MAX
The longest a swipe takes from touch to lift; a slower movement explores.
SWIPE_MIN
The shortest horizontal distance, in logical pixels, a swipe covers.
TAP_SLOP
How far, in logical pixels, a finger travels before it is moving rather than resting.