ASPxClientUtils.GetShortcutCode(keyCode, isCtrlKey, isShiftKey, isAltKey) Method
Returns a specifically generated code that uniquely identifies the combination of keys specified via the parameters.
Declaration
static GetShortcutCode(
keyCode: number,
isCtrlKey: boolean,
isShiftKey: boolean,
isAltKey: boolean
): number
Parameters
Name | Type | Description |
---|---|---|
keyCode | number | The code of the key. Codes are available via the ASPx.KeyCode client object’s members. |
isCtrlKey | boolean |
|
isShiftKey | boolean |
|
isAltKey | boolean |
|
Returns
Type | Description |
---|---|
number | The code uniquely identifying the key combination. |
Remarks
If your application logic requires using shortcuts, you need to create a set of shortcuts and then somehow identify whether the currently pressed key combination corresponds to any shortcut defined.
The GetShortcutCode method assists in creating a unique code identifying a custom combination of keys. You can store this identifier in any appropriate storage on the client side (using, for example, an ASPxHiddenField control). When an end-user presses a key or key combination, you can compare this stored identifier with the code of the key combination pressed by the user, to find out whether the user is attempting to invoke the predefined shortcut. In order to obtain the code of the key combination pressed by the user, the ASPxClientUtils.GetShortcutCodeByEvent method can be used.