SetKeyPressEventKey
int SetKeyPressEventKey (int eventData2, int virtualKey, int character, int modifiers, int isLeadByte, int isTrailByte);
Purpose
Call this function when you receive an EVENT_KEYPRESS in a panel or control callback to change the key that was pressed into another key.
If you want to change a two-byte character into a single-byte or another two-byte character, ignore the EVENT_KEYPRESS for the lead byte of the character and call SetKeyPressEventKey with the new one- or two-byte character when you receive the trail byte of the original two-byte character.
You can replace a virtual key or single-byte character with a two-byte character by calling SetKeyPressEventKey when you receive the virtual key or single-byte character event.
Parameters
Input | ||
Name | Type | Description |
eventData2 | int | The panel or control callback's eventData2 parameter. |
virtualKey | int | The virtual key code for the key or 0 if you pass a nonzero value for the character parameter. If you pass a nonzero value for this parameter, the character, isLeadByte, and isTrailByte parameters must be 0. |
character | int | A single-byte character, the lead byte of a two-byte character, or both bytes of a two-byte character. If you pass a nonzero value for this parameter, you must pass 0 for the virtualKey parameter. If you pass a single-byte character for this parameter, you must pass 0 for isLeadByte and isTrailByte. If you pass the lead byte of a two-byte character, you must pass a nonzero value for the isLeadByte parameter and 0 for the isTrailByte parameter. If you pass a complete two-byte character, you must pass 0 for the isLeadByte parameter and a nonzero value for the isTrailByte parameter. |
modifiers | int | The modifier keys or 0. Valid modifier keys are VAL_SHIFT_MODIFIER, VAL_UNDERLINE_MODIFIER (<Alt> key), VAL_MENUKEY_MODIFIER (<Ctrl> key), and VAL_SHIFT_AND_MENUKEY. If you pass more than one modifier, you must OR them together using the bitwise OR operator (|). |
isLeadByte | int | A nonzero value if you pass a lead byte of a two-byte character for the character parameter. |
isTrailByte | int | A nonzero value if you pass both bytes of a two-byte character for the character parameter. |
Return Value
Name | Type | Description |
status | int | Return value indicating whether the function was successful. A negative number indicates that an error occurred. |
Additional Information
Library: User Interface Library
Include file: userint.h
LabWindows/CVI compatibility: LabWindows/CVI 6.0 and later