Skip to main content

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

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.

See Also