Skip to main content

Module input

Module input 

Source
Expand description

What the browser did, as values with no browser in them.

The DOM’s pointer, wheel and keyboard events become the samples below in dom, and Reader turns a batch of samples into the Input and Moves the kernel reads. The split is the point: the rules that decide whether a drag is a pan or a tool’s gesture are a pure function over plain values, tested without a browser.

Re-exports§

pub use chord::chord_of;
pub use reader::Fingers;
pub use reader::Focus;
pub use reader::PanKey;
pub use reader::Read;
pub use reader::Reader;

Modules§

chord
A keystroke as the command registry names it.
dom
The one wasm-bound layer of the input path: a DOM event, as a sample.
reader
Samples in, kernel input out — and nothing of the browser in between.

Structs§

Held
Which buttons were held as an event fired — the DOM’s buttons bitmask, named. A press whose release was delivered somewhere else is recovered from this, rather than being held forever.
KeySample
PointerId
Identity of one pointer, so two fingers on a screen are told apart.
PointerSample
One pointer event, in canvas-relative CSS pixels.
WheelSample
One wheel notch, in canvas-relative CSS pixels. A trackpad pinch arrives as a ctrl-held wheel and is not told apart: both zoom.

Enums§

Edge
Whether a key sample is the key going down or coming back up.
Named
A key this app reads off the canvas. Chords are not among them — they go through chord_of to the command registry instead.
Phase
Where a pointer event falls in the life of a gesture.
Sample
One thing the browser told the canvas.
Shift
Whether shift was held as an event fired.

Functions§

bit 🔒