Obtaining Virtual Key Codes: Demo

Category:
Miscellaneous
Type:
Applications
Difficulty:
Intermediate
Author:
Anonymous

Version Compatibility: Visual Basic 6

More information:
This demo appliction illustrates how to obtain virtual key codes including TAB and SHIFT, etc. When keyboard Key, or a combination of Shift+Key is hit, the character and its virtual key code are displayed. The code is capable of distinguishing upper and lower cases (if it's lower case, the normal ascii code is shown). This is done (1) without setting the Keypreview property of the form, (2) without subclass hooking and (3) without using a third party OCX.

Instructions: Click the link below to download the code. Select 'Save' from the IE popup dialog. Once downloaded, open the .zip file from your local drive using WinZip or a comparable program to view the contents.

Download virkey.zip