@univerjs/ui v0.5.0-beta.1 • Docs
Interface: IShortcutService
The interface of the shortcut service.
Properties
Property | Type | Description | Defined in |
---|---|---|---|
shortcutChanged$ | Observable <void > | An observable that emits when the shortcuts are changed. | submodules/univer/packages/ui/src/services/shortcut/shortcut.service.ts:95 |
Methods
forceEscape()
forceEscape(): IDisposable
Make the shortcut service ignore all keyboard events.
Returns
a disposable that could be used to cancel the force escaping.
Defined in
submodules/univer/packages/ui/src/services/shortcut/shortcut.service.ts:101
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
submodules/univer/packages/ui/src/services/shortcut/shortcut.service.ts:125
getShortcutDisplay()
getShortcutDisplay(shortcut): string
Get the display string of the shortcut item.
Parameters
Parameter | Type | Description |
---|---|---|
shortcut | IShortcutItem <object > | the shortcut item to get the display string. |
Returns
string
the display string of the shortcut. For example Ctrl+Enter
.
Defined in
submodules/univer/packages/ui/src/services/shortcut/shortcut.service.ts:114
getShortcutDisplayOfCommand()
getShortcutDisplayOfCommand(id): null | string
Get the display string of the shortcut of the command.
Parameters
Parameter | Type | Description |
---|---|---|
id | string | the id of the command to get the shortcut display. |
Returns
null
| string
the display string of the shortcut. For example Ctrl+Enter
.
Defined in
submodules/univer/packages/ui/src/services/shortcut/shortcut.service.ts:120
registerShortcut()
registerShortcut(shortcut): IDisposable
Register a shortcut item to the shortcut service.
Parameters
Parameter | Type | Description |
---|---|---|
shortcut | IShortcutItem <object > | the shortcut item to be registered. |
Returns
a disposable that could be used to unregister the shortcut.
Defined in
submodules/univer/packages/ui/src/services/shortcut/shortcut.service.ts:108