Skip to content

Interface: KeyBinding<S, C>

Defined in: modal/keys.ts:72

Type Parameters

S

S

C

C

Properties

down?

optional down?: (state, key, repeat) => KeyClaim<C>

Defined in: modal/keys.ts:76

Answer for keydown; omitted = "pass". Receives the matched key and the repeat flag.

Parameters

state

S

key

string

repeat

boolean

Returns

KeyClaim<C>


hint?

optional hint?: KeyHint | ((state) => KeyHint | undefined)

Defined in: modal/keys.ts:86

Display metadata for cheat sheets and help (keyHints) — declared on the binding itself, so what the UI shows can never drift from what the key does. The function form lets a state-dependent binding describe itself per state (Enter: "send" vs "done editing"); returning undefined hides the binding in that state.


keys

keys: readonly string[]

Defined in: modal/keys.ts:74

KeyboardEvent.key values this binding matches, exactly (list both cases for letters).


up?

optional up?: (state, key) => KeyClaim<C>

Defined in: modal/keys.ts:78

Answer for keyup; omitted = "pass".

Parameters

state

S

key

string

Returns

KeyClaim<C>