| **Navigation:**  [[introduction.htm|Language Reference]] > 13 - Built-in Functions < ====== KEYCHAR (return ASCII code) ====== | [[keyboard return keystroke waiting .htm|{{btn_prev_n.gif|Previous page}}]][[introduction.htm|{{btn_home_n.gif|Return to chapter overview}}]][[keystate return keyboard status .htm|{{btn_next_n.gif|Next page}}]] | | || **KEYCHAR( )** {{blk2blue.jpg|blk2blue.jpg}} The **KEYCHAR** procedure returns the ASCII value of the last key pressed at the time the event occurred. | **Return Data Type:** | UNSIGNED | **Example:** ACCEPT !Wait for an event CASE KEYCHAR() !Process the last keystroke OF VAL('A') TO VAL('Z') ! upper case? DO ProcessUpper OF VAL('a') TO VAL('z') ! lower case? DO ProcessLower END END **See Also:** [[setkeychar specify ascii code .htm|SETKEYCHAR]] [[ask get one keystroke .htm|ASK]] [[accept the event processor .htm|ACCEPT]] [[keycode_return_last_keycode_.htm|KEYCODE]] [[select select next control to process .htm|SELECT]] [[val return ascii value .htm|VAL]] [[chr return character from ascii .htm|CHR]]