Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Translating key scan codes to ASCII equivalents
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00454785
Message ID:
00454811
Views:
33
Hi, George,

These scan codes are not ASCII codes. In the VS Glossary, they are defined as:

"scan code
A code number transmitted to a computer whenever a key is pressed or released. Each key on the keyboard has a unique scan code. This code is not the same as the ASCII code for the letter, number, or symbol shown on the key; it is a special identifier for the key itself and is always the same for a particular key. When a key is pressed, the scan code is transmitted to the computer, where a portion of the read-only memory basic input/output system (ROM BIOS) dedicated to the keyboard translates the scan code into its ASCII equivalent. Because a single key can generate more than one character—lowercase "a" and uppercase "A," for example—the ROM BIOS also keeps track of the status of keys that change the keyboard state, such as the SHIFT key, and takes them into account when translating a scan code."

I can, of course, create a translations table and do the translation through the table taking into account the modifier keys and all that, but I thought their might be an existing way of getting the ASCII value without the work of building a table.

Any thoughts?

JME
>Jim,
>
>The virtual key codes are the same as ASCII. They're defined in winuser.h. If you've got the full VS installed, this file can be found in the Include folder beneath VC98. Look for VK_
Jim Edgar
Jurix Data Corporation
jmedgar@yahoo.com

No trees were destroyed in sending this message. However, a large number of electrons were diverted from their ordinary activities and terribly inconvenienced.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform