Skip to main content

Module history

Module history 

Expand description

History keys (Repeat / Alt-Repeat / Adaptive of last output). History keys: behaviours that depend on previously resolved key output.

  • Key::Repeat re-emits the last remembered crate::key::KeyOutput as the pressed key’s own output while held.
  • Key::AltRepeat looks up that last output in a Nickel-defined table (Config::alt_repeat) and emits the mapped alternate while held (QMK-style alternate repeat for single keys).
  • Key::Adaptive looks up that last output in a per-key rule table (Hands Down / ZMK adaptive-key style). On a miss, the key emits its default output.

Structs§

AdaptiveKey
Per-site adaptive key.
AltRepeatRule
One alternate-repeat mapping: when the last remembered output equals Self::prev, Key::AltRepeat emits Self::emit.
Config
Config for history keys (alt-repeat lookup table).
Context
Context for history keys: tracks the last rememberable resolved output.
Event
Events for history keys. (None for v1.)
KeyState
Pressed state: the output being emitted (if any) for the hold duration.
PendingKeyState
Pending key state type for history keys. (No pending state.)
Ref
Reference for a history key.
System
The key::System implementation for history keys.

Enums§

Key
History key kinds.

Constants§

MAX_ADAPTIVE_RULES
Maximum number of { prev, emit } rules stored on one AdaptiveKey.

Functions§

adaptive_rules
Builds a fixed-size adaptive rule array from a shorter const list (codegen helper).
alt_repeat_rules
Builds a fixed-size alt-repeat rule array from a shorter const list (codegen helper).
is_rememberable
Whether a resolved key::KeyOutput should become the remembered last output.