home *** CD-ROM | disk | FTP | other *** search
- {--------------------------------------------------------------------}
- {- Before compiling this demo program make sure the Unit Directories-}
- {- in the Options, Directories menu specify where to find the -}
- {- FlashPac Units. -}
- {- -}
- {- Compiler Directory -}
- {- -------- ----------------- -}
- {- TP4 A:\TP4 -}
- {- TP5 A:\TP5 -}
- {- TP55 A:\TP55 -}
- {- -}
- {--------------------------------------------------------------------}
-
- program testit;
- uses Crt,FPKbd,FPVideo;
-
- Var
- Done : Boolean;
-
- Procedure TestBiosKbdClr;
- Var
- Ch : Char;
- i : Integer;
- Begin
- Writeln( 'Press "Q" to quit' );
- Repeat
- Delay(500);
- BiosKbdClr;
- Ch := ReadKey;
- Write(Ch);
- Until Ch = 'Q';
- End;
-
- Procedure TestBiosKbdGetElmt;
- Var
- Ch : Integer;
- Begin
- Writeln( 'Press "ESC" to quit' );
- Repeat
- Ch := BiosKbdGetElmt;
- Writeln('Ch = ',Ch:1);
- Until Ch = 1;
- End;
-
- Procedure TestBiosKbdHit;
- Begin
- BiosKbdClr;
- Repeat
- Writeln('Press any key to end test');
- Until BiosKbdHit;
- BiosKbdClr;
- End;
-
- Procedure TestBiosKbdRead;
- Var
- St : Str2;
- Begin
- Writeln( 'Press "Q" to quit' );
- Repeat
- BiosKbdRead(St);
- Write('St = ',St,' St[1] = ',Ord(St[1]):1);
- Writeln(' St[2] = ',Ord(St[2]):1,' Len = ',Length(St):1);
- Until St = 'Q';
- End;
-
- Procedure TestBiosKbdStat;
- Var
- Ch,Stat,i,
- Remainder : Integer;
- St : String[8];
- Begin
- ClrScr;
- St[0] := Chr(8);
- Writeln( 'Press "ESC" to quit' );
- Repeat
- Gotoxy( 1, 4 );
- Stat := BiosKbdStat;
- For i := 1 To 8 Do
- St[i] := '0';
- i := 8;
- While Stat > 0 Do Begin
- Remainder := Stat Mod 2;
- St[i] := Chr(Remainder+48);
- i := i - 1;
- Stat := Stat Div 2;
- End;
- Writeln('BiosKbdStat = ',St);
- If ( BiosKbdHit ) Then
- Ch := BiosKbdGetElmt;
- Until Ch = 1;
- End;
-
- Procedure TestDosKbdClr;
- Var
- Ch : Char;
- i : Integer;
- Begin
- Writeln( 'Press "Q" to quit' );
- Repeat
- Delay(500);
- DosKbdClr;
- Ch := ReadKey;
- Write(Ch);
- Until Ch = 'Q';
- DosKbdClr;
- End;
-
- Procedure TestDosKbdGetElmt;
- Var
- Ch : Integer;
- Begin
- Writeln( 'Press "Q" to quit' );
- Repeat
- Ch := DosKbdGetElmt;
- Writeln('Ch = ',Ch:1);
- Until Ch = 213;
- End;
-
- Procedure TestDosKbdHit;
- Begin
- DosKbdClr;
- Repeat
- Writeln('Press any key to end test');
- Until DosKbdHit;
- End;
-
- Procedure TestDosKbdRead;
- Var
- St : Str2;
- Begin
- Writeln( 'Press "Q" to quit' );
- Repeat
- DosKbdRead(St);
- Write('St = ',St,' St[1] = ',Ord(St[1]):1);
- Writeln(' St[2] = ',Ord(St[2]):1,' Len = ',Length(St):1);
- Until St = 'Q';
- End;
-
- Function GetMenuSelection : Integer;
- Var
- Item : integer;
- Begin
- Item := 0;
- TextAttr := 7;
- Repeat
- ClrWin(1,1,80,25,7);
- Window(1,1,80,25);
- GotoxyAbs(1,1);
- WriteStLn(' ');
- WriteStln(' 1. BiosKbdClr ');
- WriteStln(' 2. BiosKbdGetElmt ');
- WriteStln(' 3. BiosKbdHit ');
- WriteStln(' 4. BiosKbdRead ');
- WriteStln(' 5. BiosKbdStat ');
- WriteStln(' 6. DosKbdClr ');
- WriteStln(' 7. DosKbdGetElmt ');
- WriteStln(' 8. DosKbdHit ');
- WriteStln(' 9. DosKbdRead ');
- WriteStln(' ');
- WriteStln('10. Quit');
- WriteStln(' ');
- WriteSt('Enter selection to test ==> ');
- Readln( Item );
- Until Item In [1..10];
- GetMenuSelection := Item;
- End;
-
- begin
- DirectVideo := True;
- ClrWin(1,1,80,25,7);
- GotoxyAbs(1,1);
- Done := False;
- While Not Done Do Begin
- Case GetMenuSelection Of
- 1 : TestBiosKbdClr;
- 2 : TestBiosKbdGetElmt;
- 3 : TestBiosKbdHit;
- 4 : TestBiosKbdRead;
- 5 : TestBiosKbdStat;
- 6 : TestDosKbdClr;
- 7 : TestDosKbdGetElmt;
- 8 : TestDosKbdHit;
- 9 : TestDosKbdRead;
- 10 : Done := True;
- End;
- End;
- End.