onKeyDown (Callback)


onKeyDown (hWnd, key)

This callback is invoked when a key is pressed

Parameter Description
hWnd Handle to the window which had focus when the key was pressed
key The virtual key code of the key that was pressed

Returns

0

Remarks

This is a callback function. You must supply this function yourself. Register this function with the WinXRegOnKeyDown function.

Virtual key codes for alphanumeric keys are their ASCII values. Virtual key codes for other keys can be found in the Win32 documentation.

Examples

FUNCTION onKeyDown (hWnd, key)

'assuming we have a console attached to this app,
'print the VK code of the key that was pressed
PRINT "VK Code: ";key

END FUNCTION

Related Links

WinXRegOnKeyDown
onKeyUp
onChar
WinXIsKeyDown