Skip to main content

shortcutFromEvent

Documentation / editor/modules/shortcutFromEvent

ShortcutEvent​

Defined in: editor/modules/shortcutFromEvent.ts:15

Extends​

  • KeyboardEvent

Constructors​

Constructor​

new ShortcutEvent(type: string, init?: ShortcutEventInit): ShortcutEvent;

Defined in: editor/modules/shortcutFromEvent.ts:20

Parameters​
ParameterType

type

string

init?

ShortcutEventInit

Returns​

ShortcutEvent

Overrides​
KeyboardEvent.constructor

Properties​

modShortcut​

readonly modShortcut: string;

Defined in: editor/modules/shortcutFromEvent.ts:18

osShortcut​

readonly osShortcut: string;

Defined in: editor/modules/shortcutFromEvent.ts:17

shortcut​

readonly shortcut: string;

Defined in: editor/modules/shortcutFromEvent.ts:16

Methods​

fromKeyboardEvent()​

static fromKeyboardEvent(event: KeyboardEvent): ShortcutEvent;

Defined in: editor/modules/shortcutFromEvent.ts:27

Parameters​
ParameterType

event

KeyboardEvent

Returns​

ShortcutEvent


KeyboardEventWithShortcut​

Defined in: editor/modules/shortcutFromEvent.ts:33

Extends​

  • KeyboardEvent

Properties​

PropertyTypeDefined in

modShortcut?

string

editor/modules/shortcutFromEvent.ts:36

osShortcut?

string

editor/modules/shortcutFromEvent.ts:35

shortcut?

string

editor/modules/shortcutFromEvent.ts:34


ShortcutEventInit​

Defined in: editor/modules/shortcutFromEvent.ts:11

Extends​

  • KeyboardEventInit

Properties​

PropertyTypeDefined in

shortcut?

string

editor/modules/shortcutFromEvent.ts:12


addShortcutsToEvent()​

function addShortcutsToEvent(event: KeyboardEventWithShortcut): KeyboardEventWithShortcut;

Defined in: editor/modules/shortcutFromEvent.ts:39

Parameters​

ParameterType

event

KeyboardEventWithShortcut

Returns​

KeyboardEventWithShortcut


shortcutFromEvent()​

function shortcutFromEvent(event: KeyboardEvent): string;

Defined in: editor/modules/shortcutFromEvent.ts:58

Returns the textual representation of a shortcut given a keyboard event. Examples of shortcuts: Cmd+L Cmd+Shift+M Ctrl+O Backspace T Right Shift+Down Shift+F1 Space

Parameters​

ParameterType

event

KeyboardEvent

Returns​

string