onChar (Callback)


onChar (hWnd, char)

This callback is invoked when a character is generated, usually by pressing a key on the keyboard.

Parameter Description
hWnd The handle to the window that had input focus when the character was generated
char The ASCII code of the character that was generated

Returns

0

Remarks

This is a callback function. You must supply this function yourself. To register this callback, use the WinXRegOnChar function.

Examples

FUNCTION onChar (hWnd, char)

'assuming we have a console attached to this app,
'print the VK code of the key that was released
PRINT "You pressed: ";CHR$(char)

END FUNCTION

Related Links

WinXRegOnChar
onKeyDown
onKeyUp
WinXIsKeyDown