# GetKeyPressEventVirtualKey

int GetKeyPressEventVirtualKey (int eventData2);

## Purpose

Call this function when you receive an EVENT_KEYPRESS in a panel or control callback to get the virtual key code of the key that was pressed. This function returns 0 if the callback's eventData1 parameter contains a character instead of a virtual key code.

## Parameters

Input
Name | Type | Description
eventData2 | int | The panel or control callback's eventData2 parameter.

## Return Value

Name | Type | Description
virtualKey | int | A positive virtual key code if the EVENT_KEYPRESS event is for a virtual key press. 0 if the EVENT_KEYPRESS event is not for a virtual key press. Negative values indicate that an error occurred.