KeyBinding

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)

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.