-- find out what numeric key code is generated by any key on the keyboard -- usage: exu key_code.ex integer code sequence Code clear_screen() puts(1, "Press any key. See the key code. Press [Esc] to exit\n\n") while 1 do Code={} while 1 do code = get_key() if code != -1 then Code &= code else exit end if end while if length(Code) = 1 and Code[1]!=-1 then code=Code[1] if code = 27 then puts(1, "\nKey [Esc], the code is 27, we'll exit.\n\n") exit end if puts(1, "\nKey -[" & code & "]- the key code is: ") printf(1, "%d", code) elsif length(Code) > 1 then puts(1, "\nThe key code is: ") print(1, Code) else end if end while puts(1, "Press Enter ...") code = getc(0)