Skip to main content

shortcutFromEvent

ai-research-agent / editor/modules/shortcutFromEvent

Functions

addShortcutsToEvent()

function addShortcutsToEvent(event): KeyboardEventWithShortcut

Parameters

ParameterType

event

KeyboardEventWithShortcut

Returns

KeyboardEventWithShortcut


shortcutFromEvent()

function shortcutFromEvent(event): string

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

Classes

ShortcutEvent

Extends

  • KeyboardEvent

Constructors

new ShortcutEvent()
new ShortcutEvent(type, init?): ShortcutEvent
Parameters
ParameterType

type

string

init?

ShortcutEventInit

Returns

ShortcutEvent

Overrides

KeyboardEvent.constructor

Methods

fromKeyboardEvent()
static fromKeyboardEvent(event): ShortcutEvent
Parameters
ParameterType

event

KeyboardEvent

Returns

ShortcutEvent

Properties

modShortcut
readonly modShortcut: string;
osShortcut
readonly osShortcut: string;
shortcut
readonly shortcut: string;

Interfaces

KeyboardEventWithShortcut

Extends

  • KeyboardEvent

Properties

modShortcut?
optional modShortcut: string;
osShortcut?
optional osShortcut: string;
shortcut?
optional shortcut: string;

ShortcutEventInit

Extends

  • KeyboardEventInit

Properties

shortcut?
optional shortcut: string;