| **Navigation:**  [[introduction.htm|Language Reference]] > 13 - Built-in Functions > [[isalpha return alphabetic character .htm|ISALPHA (return alphabetic character)]] > ====== KEYCODE (return last keycode) ====== | [[isalpha return alphabetic character .htm|{{btn_prev_n.gif|Previous page}}]][[isalpha return alphabetic character .htm|{{btn_home_n.gif|Return to chapter overview}}]][[isgroup return group type or not .htm|{{btn_next_n.gif|Next page}}]] | | || **KEYCODE( )** {{blk2blue.jpg|blk2blue.jpg}} The **KEYCODE** procedure returns the keycode of the last key pressed at the time the event occurred, or the last keycode value set by the SETKEYCODE procedure. The current list of key codes can be found in the [[keycode equates list.htm|KEYCODES.CLW]] source file. | **Return Data Type:** | UNSIGNED | **Example:** ACCEPT !Loop on the display CASE KEYCODE() !Process the keystroke OF UpKey !up arrow DO GetRecordUp !get a record OF DownKey !down arrow DO GetRecordDn !get a record END END **See Also:** [[ask get one keystroke .htm|ASK]] [[accept the event processor .htm|ACCEPT]] [[keyboard return keystroke waiting .htm|KEYBOARD]] [[keychar_return_ascii_code_.htm|KEYCHAR]] [[setkeycode specify keycode .htm|SETKEYCODE]] [[keystate return keyboard status .htm|KEYSTATE]] [[clarion keycodes.htm|Keycode Equate Labels]] [[keycode equates list.htm|Keycode Equates List]]