User Tools

Site Tools


clarion_keycodes.htm
Navigation:  Language Reference > 14 - Dates, Time and Keycodes >====== Clarion Keycodes ====== Previous pageReturn to chapter overviewNext page

Windows Keycode Mapping Format

Each key on the keyboard is assigned a keycode. Keycodes are 16-bit values where the low-order 8 bits (values from 0 to 255) represent the key that was pressed, and the high-order 8 bits indicate the state of the Shift, Ctrl, and Alt keys. Keycodes are returned by the KEYCODE() and KEYBOARD() procedures, and use the following format:

| A | C | S | CODE |
Bits: 10 9   8   7       0
CODE - The Key pressed
A - Alt key bit
C - Ctrl key bit
S - Shift key bit

Calculating a keycode's numeric value is generally unnecessary, since most of the possible key combinations are listed as EQUATE statements in KEYCODES.CLW (INCLUDE this file and use the equates instead of the numbers for better code readability).

KEYCODES.CLW

Keycode equate labels assign mnemonic labels to Clarion keycodes. The keycode equates file (KEYCODES.CLW) is a Clarion source file which contains an EQUATE statement for each keycode. This file is located in the install \LIBSRC directory.

It may be merged into a source PROGRAM by placing the following statement in the global data section:

INCLUDE('KEYCODES.CLW')

This file contains EQUATE statements for most of the keycodes supported by Windows. These keycode EQUATEs are used for greater code readability wherever you need to set or compare keyboard input.

See Also:

KEYCODE

KEYBOARD

KEYCHAR

KEYSTATE

SETKEYCODE

ALERT

ALRT

Keycode Equates List

clarion_keycodes.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1