Expand description
Track-press auto-repeat for scrollbars.
Compose parity (TrackPressScroller in
compose/foundation/.../Scrollbar.skiko.kt): pressing the scrollbar track
outside the thumb pages once immediately, then keeps paging toward the held
point after a 300ms delay, every 100ms, until release.
The repeat itself cannot live in the scrollbar hit closures: those run on
input dispatch, but repeats must fire on time even when the pointer sits
still and no input arrives. So the track-press closure registers a page
callback here, and the app runtime polls it once per tick next to
poll_long_press, with the next fire time feeding next_wakeup_deadline
so a sleeping host still wakes up to page.
Functionsยง
- begin_
track_ repeat - Start (or restart) paging for
pointer. The caller pages once immediately; the first repeat fires [FIRST_DELAY_MS] later. - cancel_
all_ track_ repeats - Stop every repeat. Used on global pointer cancel, where per-pointer bookkeeping may already be gone.
- cancel_
track_ repeat - Stop paging for
pointer. No-op when another pointer holds the repeat. - cancel_
track_ repeat_ for_ touch - Convenience for runtime press/release/cancel paths.
- key_
for_ touch - Same key from the runtime side, which addresses pointers by touch id.
- pointer_
key - Stable key for the pointer behind an event. Touch fingers keep their id so two fingers can hold two tracks; mouse and pen collapse to one key.
- poll_
track_ repeat - Fire due repeats. Call once per tick next to the other gesture polls. Returns true when a page ran (and a frame was requested).
- track_
repeat_ deadline - Next repeat fire time, for the host wakeup deadline.