Back to Devexpress

AssignShortcutCommand.execute(keyCode, callback) Method

aspnet-js-assignshortcutcommand-dot-execute-x28-keycode-callback-x29.md

latest1.4 KB
Original Source

AssignShortcutCommand.execute(keyCode, callback) Method

Executes the AssignShortcutCommand command with the specified parameters.

Declaration

ts
execute(
    keyCode: number,
    callback: () => void
): boolean

Parameters

NameTypeDescription
keyCodenumber

The combination of keys specified for a shortcut. This code is specified using the ASPxClientUtils.GetShortcutCode method.

| | callback | () => void |

A callback function to execute when a shortcut is activated.

|

Returns

TypeDescription
boolean

true if the command has been successfully executed; false if the command execution has failed.

|

Remarks

Usage example:

javascript
richEdit.commands.assignShortcut.execute(ASPxClientUtils.GetShortcutCode(ASPx.KeyCode.Key_u, false, false, false), function(){richEdit.commands.updateField.execute()})

You cannot assign custom shortcuts to the RichEditCommands.copy, RichEditCommands.paste and RichEditCommands.cut commands.

See Also

AssignShortcutCommand Class

AssignShortcutCommand Members