Expand description
The seam between an OS input backend and Teksilo’s pointer vocabulary.
Everything above this module speaks PointerSample / ScrollSample /
GestureEvent. Everything below it speaks whatever the window system
speaks. PointerBackend is the one door between the two, and
BackendCaps is the honest declaration of what the backend on the other
side can and cannot report.
§Why a trait rather than a function
Three reasons, in the order they will bite:
- The winit 0.31 upgrade. winit 0.30 models touch as
WindowEvent::Touch { id: u64, phase: TouchPhase, force, .. }; 0.31 replaces it with a unified pointer API (PointerKind,PointerSource,FingerId, theTabletTool*family). That is a rewrite of one implementation of this trait, not of the framework. - Testing without an OS. The conformance suite
(
tests/backend_conformance.rs) drives recorded event vectors through this trait and checks six invariants. A future backend earns its trust by passing the same suite. - Honesty about capability. A consumer that must know whether cancels
are reported — or whether a finger can drag the window — should ask,
not guess from
cfg!(target_os = ...).BackendCapsis that answer, and everyfalsein it is a documented platform fact rather than a to-do.
Reference: docs/touch-and-pen.md, “Platform capabilities”.
Structs§
- Backend
Caps - What a backend can actually report.
Enums§
- Backend
Event - One OS packet on its way into
PointerBackend::translate. - Input
Sample - One translated input sample, ready to enter a widget tree.
- Platform
Kind - Which OS a
BackendCapsrow describes. - Soft
Keyboard Support - How a platform can be asked to raise the on-screen keyboard.
Traits§
- Pointer
Backend - Turns OS packets into
InputSamples.