Admin Production ni-theme
Current Publication

GetKeyPressEventVirtualKey

LabWindows/CVI

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.

Additional Information

Library: User Interface Library

Include file: userint.h

LabWindows/CVI compatibility: LabWindows/CVI 6.0 and later

Example

Refer to userint\multikey.cws for an example of using the GetKeyPressEventVirtualKey function.