Skip to main content
A newer version of this page is available. .

AssignShortcutCommand.execute(keyCode, callback) Method

Executes the AssignShortcutCommand command by applying the specified settings.

May result in taking no action if the command’s state does not allow command execution. Use the object’s getState method to check the command state.

Declaration

execute(
    keyCode: number,
    callback: Function
): boolean

Parameters

Name Type Description
keyCode number

A specifically generated code that uniquely identifies the combination of keys specified for a shortcut. This code is specified using the ASPxClientUtils.GetShortcutCode method.

callback Function

A callback function to execute when a shortcut is activated.

Returns

Type Description
boolean

A Boolean value identifying whether method execution was successful or failed.

Remarks

The execute method checks the command state (obtained using the getState method) before executing, and decides whether the action can be performed.

Usage example:


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