home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
progpas
/
visible.arj
/
INKEY
< prev
next >
Wrap
Text File
|
1985-08-08
|
640b
|
23 lines
PROGRAM INKEY; {program shows direct key input, with explicit echo}
{note that function keys return their extended code in hibyte}
VAR
CH:CHAR;
KEY:INTEGER;
BEGIN
REPEAT
WRITELN('key?');
KEY := ORD(INKEY);
IF KEY MOD 256 = 0 THEN {if CH = 0, its a function key}
BEGIN {extended code}
CH := CHR(0);
WRITE("that's a function key; ");
WRITELN('second code = ',KEY / 256);
END ELSE
BEGIN
CH := CHR(KEY);
WRITELN('the key was:',CH);
END;
UNTIL CH = '.';
END.