KeyBinding

data class KeyBinding(val key: String? = null, val mac: String? = null, val win: String? = null, val linux: String? = null, val run: (EditorSession) -> Boolean? = null, val shift: (EditorSession) -> Boolean? = null, val any: (EditorSession, KeyEvent) -> Boolean? = null, val anyRaw: (EditorSession, String, Boolean, Boolean, Boolean, Boolean) -> Boolean? = null, val preventDefault: Boolean = false, val stopPropagation: Boolean = false)

A key binding maps a key name (e.g. "Ctrl-Enter") to a command.

Parameters

key

The key name for non-Mac platforms.

mac

The key name for macOS (uses Meta instead of Ctrl for Mod-).

win

Windows-specific binding (falls back to key if absent).

linux

Linux-specific binding (falls back to key if absent).

run

Command to run. Returns true if handled.

shift

Shift-variant of the command.

any

Called for every key event matching the base key (shift insensitive).

preventDefault

Whether to prevent the default browser action.

stopPropagation

Whether to stop event propagation.

Constructors

Link copied to clipboard
constructor(key: String? = null, mac: String? = null, win: String? = null, linux: String? = null, run: (EditorSession) -> Boolean? = null, shift: (EditorSession) -> Boolean? = null, any: (EditorSession, KeyEvent) -> Boolean? = null, anyRaw: (EditorSession, String, Boolean, Boolean, Boolean, Boolean) -> Boolean? = null, preventDefault: Boolean = false, stopPropagation: Boolean = false)

Properties

Link copied to clipboard
Link copied to clipboard

Raw key handler for keys that don't produce a Compose KeyEvent. Called with the browser's key string and modifier state. On wasmJs, Skiko doesn't generate Compose KeyEvents for some symbol keys on the canvas (/, ?, ~, etc.). This handler receives them from the document-level keydown listener.

Link copied to clipboard
val key: String?
Link copied to clipboard
Link copied to clipboard
val mac: String?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val win: String?