-- find out what numeric key code is generated by any key on the keyboard
-- usage:
--          ex key

integer code

puts(1, "Press any key. I'll show you the key code. Press q to quit\n\n")
while 1 do
    code = get_key()
    if code != -1 then
	printf(1, "The key code is: %d\n", code)
	if code = 'q' then
	    exit
	end if
    end if
end while
