home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
forth
/
compiler
/
fpc
/
source
/
p3_17bs.seq
< prev
next >
Wrap
Text File
|
1990-04-07
|
3KB
|
66 lines
\ Balraj Sidhu Set: 14D4
\ Comp 462 - Forth
\ Date: April 7, 1990
\ Problem 3.17
: pckey ( -- n flag )
bioskey dup 127 and \ mask off low 8-bits to check for ASCII
if 127 and true \ Yes its ASCII, mask off ASCII value.
else flip false \ Its a function key, leave scan code.
then ;
\ test ASCII keys and function keys.
: pckey_test ( -- )
begin cr pckey
if dup control m =
if drop exit then \ exit infinite loop if enter pressed
." ASCII key character code = "
dup . emit
else ." Function key scan code = " . \ display scan code
then again ;
COMMENT:
Run of above program.
Code = Scan Code.
Key Code key Code
--------- --------- --------- ----------
F1 59 Shift F1 84
F2 60 Shift F2 85
F3 61 Shift F3 86
F4 62 Shift F4 87
F5 63 Shift F5 88
F6 64 Shift F6 89
F7 65 Shift F7 90
F8 66 Shift F8 91
F9 67 Shift F9 92
F10 68 Shift F10 93
Key Code key Code
--------- --------- --------- ----------
Alt F1 104 Ctl F1 94
Alt F2 105 Ctl F2 95
Alt F3 106 Ctl F3 96
Alt F4 107 Ctl F4 97
Alt F5 108 Ctl F5 98
Alt F6 109 Ctl F6 99
Alt F7 110 Ctl F7 100
Alt F8 111 Ctl F8 101
Alt F9 112 Ctl F9 102
Alt F10 113 Ctl F10 103
Key Code key Code
--------- --------- --------- ----------
Ins 82 Del 83
Home 71 End 79
PgUp 73 PgDn 81
Up Arrow 72 Down Arrow 80
Left Arrow 75 Right Arrow 77
COMMENT;