API Reference
@univerjs
@univerjs/ui
interfaces
Ishortcutservice

@univerjs/ui v0.3.0Docs


Interface: IShortcutService

The interface of the shortcut service.

Properties

PropertyTypeDescriptionDefined in
shortcutChanged$Observable<void>An observable that emits when the shortcuts are changed.packages/ui/src/services/shortcut/shortcut.service.ts:96 (opens in a new tab)

Methods

forceEscape()

forceEscape(): IDisposable

Make the shortcut service ignore all keyboard events.

Returns

IDisposable

a disposable that could be used to cancel the force escaping.

Defined in

packages/ui/src/services/shortcut/shortcut.service.ts:102 (opens in a new tab)


getAllShortcuts()

getAllShortcuts(): IShortcutItem<object>[]

Get all the shortcuts registered in the shortcut service.

Returns

IShortcutItem<object>[]

all the shortcuts registered in the shortcut service.

Defined in

packages/ui/src/services/shortcut/shortcut.service.ts:126 (opens in a new tab)


getShortcutDisplay()

getShortcutDisplay(shortcut): string

Get the display string of the shortcut item.

Parameters

ParameterTypeDescription
shortcutIShortcutItem<object>the shortcut item to get the display string.

Returns

string

the display string of the shortcut. For example Ctrl+Enter.

Defined in

packages/ui/src/services/shortcut/shortcut.service.ts:115 (opens in a new tab)


getShortcutDisplayOfCommand()

getShortcutDisplayOfCommand(id): null | string

Get the display string of the shortcut of the command.

Parameters

ParameterTypeDescription
idstringthe id of the command to get the shortcut display.

Returns

null | string

the display string of the shortcut. For example Ctrl+Enter.

Defined in

packages/ui/src/services/shortcut/shortcut.service.ts:121 (opens in a new tab)


registerShortcut()

registerShortcut(shortcut): IDisposable

Register a shortcut item to the shortcut service.

Parameters

ParameterTypeDescription
shortcutIShortcutItem<object>the shortcut item to be registered.

Returns

IDisposable

a disposable that could be used to unregister the shortcut.

Defined in

packages/ui/src/services/shortcut/shortcut.service.ts:109 (opens in a new tab)


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.