fn
onKeyStroke
testeddemoListen for keyboard strokes. Accepts a key, list of keys, or a predicate and fires the handler for matching events. Auto-cleans up on scope dispose. Overload 1: Explicit key filter
Demo
Loading demo…
Signatures
ts
export function onKeyStroke(key: KeyFilter, handler: (event: KeyboardEvent) => void, options?: OnKeyStrokeOptions): VoidFunction;ts
export function onKeyStroke(handler: (event: KeyboardEvent) => void, options?: OnKeyStrokeOptions): VoidFunction;Parameters
| Parameter | Type | Description |
|---|---|---|
args? | any[] | — |
Returns
VoidFunction