Skip to content

Keyboard

Bindings for @solid-primitives/keyboard.

useKeyDownEvent

let useKeyDownEvent(): Accessor<KeyboardEvent>

useKeyDownList

let useKeyDownList(): Accessor<string[]>

useCurrentlyHeldKey

let useCurrentlyHeldKey(): Accessor<string | null>

useKeyDownSequence

let useKeyDownSequence(): Accessor<string[][]>

createKeyHold

let createKeyHold(
    key: string,
    ?preventDefault: bool
    ): Accessor<bool>

createShortcut

let createShortcut(
    keys: string[],
    handler: unit -> unit,
    ?preventDefault: bool,
    ?requireReset: bool
    ): unit

The keys must be pressed in the order given.

Edit this page