Line

You are reading the unreleased docs (next). See latest (v0.9)

ui/client/features/command-palette/domain/PaletteKeys

Pure (DOMAIN-001): keyboard rules of the palette.

Cockpit client (features), next. Source: ui/client/features/command-palette/domain/PaletteKeys.ts.

Functions#

isPaletteShortcut()#

isPaletteShortcut(e): boolean

Defined in: ui/client/features/command-palette/domain/PaletteKeys.ts:15

Ctrl+K (Cmd+K on macOS) toggles the palette. Shift/Alt variants are left to the browser/editor.

Parameters#

e

ShortcutLike

Returns#

boolean


isQuickOpenShortcut()#

isQuickOpenShortcut(e): boolean

Defined in: ui/client/features/command-palette/domain/PaletteKeys.ts:21

Ctrl+P (Cmd+P on macOS), the quick-open shortcut: opens the same palette, browsers' print dialog is pre-empted by the capture-phase preventDefault in subscribePaletteShortcut.

Parameters#

e

ShortcutLike

Returns#

boolean


moveActive()#

moveActive(current, count, key): number

Defined in: ui/client/features/command-palette/domain/PaletteKeys.ts:5

Next active index for ArrowUp/ArrowDown/Home/End, wrapping. Returns the current one for other keys.

Parameters#

current

number

count

number

key

string

Returns#

number