home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
PROGRAM
/
PASCAL
/
KEYBOARD
/
KEYDEMO.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1988-08-16
|
2KB
|
90 lines
Program KeyBoardDemo;
Uses
Crt,DOS, KeyBoard;
Const
ShiftArray : Array [ShiftKeys] of String [20] = (
'RightShiftKeyPressed',
'LeftShiftKeyPressed',
'CtrlKeyPressed',
'AltKeyPressed',
'ScrollLockStatus',
'NumLockStatus',
'CapsLockStatus',
'InsertStatus',
'LeftCtrlKeyPressed',
'LeftAltKeyPressed',
'SysReqKeyPressed',
'PauseActive',
'ScrollLockKeyPressed',
'NumLockKeyPressed',
'CapsLockKeyPressed',
'InsertKeyPressed',
'RightCtrlKeyPressed',
'RightAltKeyPressed',
'KeyBoard101');
Procedure ShowShift;
Type
String2 = String[2];
ByteSet = Set of Byte;
Var
Index,E : Byte;
B,M : Word;
BS : ByteSet absolute B;
MS : Byteset absolute M;
ES : ByteSet absolute E;
Key : ShiftKeys;
Const
S : String2 = '01';
Begin
B := BIOSshift;
M := MemShift (E);
E := MemW [$40:$96];
For Index := 0 to 15 do Begin
GotoXY (2*Index+11,3);
Write (s[Byte(Index in BS)+1]);
GotoXY (2*Index+11,4);
Write (s[Byte(Index in MS)+1]);
End;
For Index := 0 to 7 do Begin
GotoXY (2*Index+11,5);
Write (s[Byte(Index in ES)+1]);
End;
Writeln;
UpDateShift;
For Key := RightShiftKeyPressed to KeyBoard101 do Begin
If Key in ShiftStatus Then Write (ShiftArray[Key])
Else Write (' ');
Writeln;
End;
End; { ShowShift }
Var
Ready : Boolean;
Ch : Char;
Begin
DirectVideo := True;
ClrScr;
Writeln ('ShowShift 1 1 1 1 1 1');
Writeln (' 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5');
Writeln ('BIOS :');
Writeln ('Memory :');
Writeln ('Status : ');
Ready := False;
Repeat
ShowShift;
Ready := KeyPressed;
If Ready Then Begin
Ch := ReadKey;
Ready := Ch = ' ';
If Ch = #0 Then Ch := ReadKey;
End;
Until Ready;
End.