Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

ShortcutOptions Class

Contains a shortcut’s options.

#Declaration

TypeScript
export class ShortcutOptions

#Remarks

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

// 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

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

#Parameters

Name Type Description
keyCode KeyCode

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

TypeScript
alt: boolean

#Property Value

Type Description
boolean

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

#ctrl Property

Specifies whether the shortcut involves the Ctrl key.

#Declaration

TypeScript
ctrl: boolean

#Property Value

Type Description
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

TypeScript
keyCode: KeyCode

#Property Value

Type Description
KeyCode

A key’s code.

#meta Property

Specifies whether the shortcut involves the Meta key.

#Declaration

TypeScript
meta: boolean

#Property Value

Type Description
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

TypeScript
shift: boolean

#Property Value

Type Description
boolean

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