Back to Devexpress

ShortcutOptions Class

aspnetcore-js-devexpress-dot-richedit-f6a7cfe5.md

latest2.8 KB
Original Source

ShortcutOptions Class

Contains a shortcut’s options.

Declaration

ts
export class ShortcutOptions

Remarks

You can use an object of the ShortcutOptions type in the assignShortcut(shortcut, callback) method.

javascript
// adds the Ctrl+1 shortcut
var ctrlKey = true;
var shortcutOpts = new DevExpress.RichEdit.ShortcutOptions( 
    DevExpress.RichEdit.KeyCode.Key_1, ctrlKey);    
richEdit.assignShortcut(shortcutOpts, function () { alert('your actions here'); });

constructor(keyCode)

Initializes a new instance of the ShortcutOptions class.

Declaration

ts
constructor(
    keyCode: KeyCode,
    ctrl?: boolean,
    alt?: boolean,
    shift?: boolean,
    meta?: boolean
)

Parameters

NameTypeDescription
keyCodeKeyCode

A key’s code.

| | ctrl | boolean |

true , to involve the Ctlr key in the shortcut; otherwise, false

| | alt | boolean |

true , to involve the Alt key in the shortcut; otherwise, false

| | shift | boolean |

true , to involve the Shift key in the shortcut; otherwise, false

| | meta | boolean |

true , to involve the Meta key in the shortcut; otherwise, false

|

Properties

alt Property

Specifies whether the shortcut involves the Alt key.

Declaration

ts
alt: boolean

Property Value

TypeDescription
boolean

true , to involve the Alt key in the shortcut; otherwise, false

|

ctrl Property

Specifies whether the shortcut involves the Ctrl key.

Declaration

ts
ctrl: boolean

Property Value

TypeDescription
boolean

true , to involve the Ctrl key in the shortcut; otherwise, false

|

keyCode Property

Specifies a code of a key that the shortcut involves.

Declaration

ts
keyCode: KeyCode

Property Value

TypeDescription
KeyCode

A key’s code.

|

meta Property

Specifies whether the shortcut involves the Meta key.

Declaration

ts
meta: boolean

Property Value

TypeDescription
boolean

true , to involve the Meta key in the shortcut; otherwise, false

|

Remarks

The Meta key corresponds to the Windows key on Microsoft keyboards, and to the Command key on Apple keyboards.

shift Property

Specifies whether the shortcut involves the Shift key.

Declaration

ts
shift: boolean

Property Value

TypeDescription
boolean

true , to involve the Shift key in the shortcut; otherwise, false

|