| **Navigation:**  [[introduction.htm|Language Reference]] > 14 - Dates, Time and Keycodes >====== Clarion Keycodes ====== | [[standard time.htm|{{btn_prev_n.gif|Previous page}}]][[introduction.htm|{{btn_home_n.gif|Return to chapter overview}}]][[dde ole and ocx.htm|{{btn_next_n.gif|Next 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 ([[keycode equates list.htm|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 return last keycode .htm|KEYCODE]] [[keyboard return keystroke waiting .htm|KEYBOARD]] [[keychar return ascii code .htm|KEYCHAR]] [[keystate return keyboard status .htm|KEYSTATE]] [[setkeycode specify keycode .htm|SETKEYCODE]] [[alert set event generation key .htm|ALERT]] [[alrt set window hot keys .htm|ALRT]] [[keycode equates list.htm|Keycode Equates List]]