mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-05-22 04:33:39 +02:00
29 lines
605 B
ObjectPascal
29 lines
605 B
ObjectPascal
Program Example3;
|
|
|
|
{ Program to demonstrate the GetKeyEventShiftState function. }
|
|
|
|
Uses keyboard;
|
|
|
|
Var
|
|
K : TKeyEvent;
|
|
S : Byte;
|
|
|
|
begin
|
|
InitKeyBoard;
|
|
Write('Press keys combined with CTRL/SHIFT/ALT');
|
|
Writeln(', or press "q" to end.');
|
|
Repeat
|
|
K:=GetKeyEvent;
|
|
K:=TranslateKeyEvent(K);
|
|
S:=GetKeyEventShiftState(K);
|
|
If (S=0) then
|
|
Writeln('No special keys pressed')
|
|
else
|
|
begin
|
|
Writeln('Detected special keys : ',ShiftStateToString(K,False));
|
|
Writeln('Got key : ',KeyEventToString(K));
|
|
end;
|
|
Until (GetKeyEventChar(K)='q');
|
|
DoneKeyboard;
|
|
end.
|