home *** CD-ROM | disk | FTP | other *** search
- uses DOS,CRT;
- (* Edwin SChwarz *)
-
- const I16=$1000;
-
- var reg:Registers;
- Key:Word;
- KeyHi,KeyLo:Byte;
- Esc:String;
- f:Text;
-
- function GetKey:word;
- begin
- reg.ax:=I16;
- intr($16,reg);
- GetKey:=reg.ax
- end;
-
- function LSP:boolean;
- begin
- LSP:=false;
- reg.ax:=$0200;
- intr($16,reg);
- if reg.ax and 2 = 2 then LSP:=true
- end;
-
- procedure PutKey(x:word);
- var s:string;
- begin
- Str(LO(x),s);
- Esc:=Esc+s+';';
- if (Lo(x)=0) or ((Lo(x)=$E0) and (Hi(x)<>0)) then
- begin
- write(#249);
- Str(Hi(x),s);
- Esc:=Esc+s+';'
- end
- else write(chr(Lo(x)))
- end;
-
- procedure GetKeyDef;
- begin
- repeat
- Key:=GetKey;
- if (Lo(Key)=13) and LSP then exit;
- if (Lo(Key)=$E0) and (Hi(Key)<>0) then Key:=Key and $FF00;
- PutKey(Key);
- until false
- end;
-
- begin
- Assign(f,'');
- Rewrite(f);
- repeat
- Esc:=#27+'[';
- writeln;
- write('Alt? ');
- Key:=GetKey;
- if (Lo(Key)=13) and LSP then begin close(f); HALT end;
- PutKey(Key);
- writeln;
- write('Neu? ');
- GetKeyDef;
- write(f,Esc+';p');
- until false
- end.
-