Module gate

Module gate 

Source
Expand description

Input gating: when a button gesture means something other than what it would normally mean.

Three conditions make a gesture unsafe to act on literally:

  • GateReason::ScreenOff — the user cannot see what they would be acting on, so the press only brings the display back.
  • GateReason::AlertActive — a locate alert is running, and whoever just found the device meant to silence it, not to navigate its menus.
  • GateReason::Refreshing — a persistent panel is mid-refresh, so the visible selection and the acted-on selection could differ.

One gesture always passes through regardless: [ButtonEvent::VeryLong], the power-off hold. It is deliberate enough to mean it, it is the documented escape from every state, and requiring a lit screen first would make a dark unresponsive device impossible to turn off.

§Latching

The decision is latched at the press that starts a gesture, not at the event that ends it. A double-click begun against a dark panel resolves several hundred milliseconds later, by which time the panel is lit again; without the latch it would both wake the display and select something. Feed Gate::on_press on each press edge and Gate::settle once the recognizer comes to rest, and the whole chord is judged by the conditions that held when it began.

Structs§

Gate
Input gate.

Enums§

Disposition
What to do with a resolved gesture.
GateReason
A condition that changes what a gesture means.