Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Translating key scan codes to ASCII equivalents
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00454785
Message ID:
00454811
Vues:
34
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform