The requested page is not available for the requested platform. You are viewing the content for Default platform.

ASPxClientUtils.GetShortcutCodeByEvent(htmlEvent) Method

Returns a specifically generated code that uniquely identifies the pressed key combination, which is specified by the related HTML event.

Declaration

static GetShortcutCodeByEvent(htmlEvent: any): number

Parameters

Name Type Description
htmlEvent any

A DHTML event object that relates to a key combination being pressed.

Returns

Type Description
number

An integer value that represents the code uniquely identifying the specified key combination.

Remarks

If your application logic requires using shortcuts, you need to create a set of shortcuts and then identify whether the currently pressed key combination corresponds to any defined shortcut.

The GetShortcutCodeByEvent method allows you to easily identify on the client side, the key combination pressed by an end-user. Pass a DHTML event object related to the key combination via the GetShortcutCodeByEvent method's htmlEvent parameter. The GetShortcutCodeByEvent method returns a specifically generated code that uniquely identifies the pressed key combination. You can compare this code with codes previously generated for your shortcuts by using the ASPxClientUtils.GetShortcutCode or ASPxClientUtils.StringToShortcutCode methods.

For more details on how to work with shortcuts on the client side, refer to the following Code Central example: E1137.

See Also