10
20
30 :
40 VDU 10,8:IF POS<66:VDU 26,10,8:IF POS<66:MODE 128 ELSE VDU 13
50 DIM N$(127),K% 256
60 FOR A%=0 TO 127:READ N$(A%):K%?A%=0:IF N$(A%)="œY":IF HIMEM>&FFFF:N$(A%)="£Y"
70 NEXT A%
80 :
90 DATA Shift,Ctrl,Alt,Left Shift,Left Ctrl,Left Alt,Right Shift,Right Ctrl,Right Alt
100 DATA Mouse Left,Mouse Middle,Mouse Right,-13,-14,-15,-16
110 DATA Q ,3,4,5 ,f4,8 ,f7,-=,^~ ,Left ,Keypad 6,Keypad 7, f11 ,f12,f10,Scroll
120 DATA f0/Print,W,E,T ,7 ,I ,9 ,0 ,_ ,Down ,Keypad 8,Keypad 9, Break,'~,"œY",Backspace
130 DATA 1 ,2,D,R ,6 ,U ,O ,P ,[ ,Up ,Keypad +,Keypad -, Keypad Return,Insert,Home,Page Up
140 DATA Caps ,A,X,F ,Y ,J ,K ,@ ,":",Return,Keypad /,Keypad Delete,Keypad .,NumLock,Page Down,'@
150 DATA ShiftLock,S,C,G ,H ,N ,L ,
160 DATA TAB,Z,SPACE,V ,B ,M ,< ,> ,"?",COPY ,Keypad 0,Keypad 1, Keypad 3 ,No Convert,Convert,Kana
170 DATA Escape ,f1,f2,f3,f5,f6,f8,f9,"\",Right ,Keypad 4,Keypad 5, Keypad 2 ,Windows Left,Windows Right,Windows Menu
180 :
190 ON ERROR PRINT STRING$(16+B%DIV16,CHR$10):REPORT:PROCend
200 PRINT "Press Shift-Escape to finish"'STRING$(17,CHR$10)
210 FOR A%=0 TO 7:OSCLI"FX"+STR$(221+A%)+","+STR$((A%EOR4)*16+128):NEXT
220 OSCLI"FX219,9":OSCLI"FX229,1":*FX4,2
230 IF PAGE>&FFFF:*ESC OFF
240 VDU 23,1
250 REPEAT
260 C%=0
270 PRINT STRING$(17,CHR$11)
280 FOR A%=-1 TO -256 STEP -16
290 FOR B%=A% TO A%-15 STEP -1
300 P%=INKEY B%:K%?(B%EOR-1)=P%:IF P%=0:PRINT SPC4
310 IF INKEY-1:IF INKEY-113:PRINT STRING$(16+B%DIV16,CHR$10):PROCend
320 NEXT:PRINT
330 NEXT
340 IF C%:FOR A%=0 TO 127:IF K%?A%:PRINT
350 PRINT STRING$(40," ")
360 PRINT:D%=INKEY(0):REPEATUNTILINKEY(0)=-1
370 IF D%<>-1:PRINTFNh0(D%,2)" "FNc0(D%)" "FNc2(D%)" "FNc1(D%)
380 UNTIL FALSE
390 :
400 DEFPROCend
410 PRINT:VDU23,1,1
420 FOR A%=0 TO 7:OSCLI"FX"+STR$(221+A%)+","+STR$((A%EOR4)*16+96):NEXT
430 OSCLI"FX225,1":OSCLI"FX229":OSCLI"FX4":*FX15
440 IF PAGE>&FFFF:*ESC ON
450 ON ERROR END
460 REPEAT UNTIL INKEY(0)=-1
470 END
480 :
490 DEFFNd(A%,N%)=RIGHT$(" "+STR$A%,N%)
500 DEFFNh0(A%,N%)=RIGHT$("0000000"+STR$~A%,N%)
510 DEFFNc0(A%):IFA%>127:="|!"+FNc0(A%AND127)
520 IFA%<32ORA%=127:="|"+CHR$(A%EOR64)ELSE=LEFT$("|",A%=34ORA%=124)+CHR$A%
530 DEFFNc1(A%):IFA%<32ORA%=127:="."ELSE=CHR$A%
540 DEFFNc2(A%):IFA%<32ORA%=127:="^"+CHR$(A%EOR64)ELSE=CHR$A%