mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-11 15:48:11 +02:00
26 lines
507 B
ObjectPascal
26 lines
507 B
ObjectPascal
Program Example2;
|
|
|
|
{ Program to demonstrate the GetKeyEventCode function. }
|
|
|
|
Uses keyboard;
|
|
|
|
Var
|
|
K : TKeyEvent;
|
|
|
|
begin
|
|
InitKeyBoard;
|
|
Writeln('Press function keys, or press "q" to end.');
|
|
Repeat
|
|
K:=GetKeyEvent;
|
|
K:=TranslateKeyEvent(K);
|
|
If (GetKeyEventFlags(K)<>KbfnKey) then
|
|
Writeln('Not a function key')
|
|
else
|
|
begin
|
|
Write('Got key (',GetKeyEventCode(K));
|
|
Writeln(') : ',KeyEventToString(K));
|
|
end;
|
|
Until (GetKeyEventChar(K)='q');
|
|
DoneKeyboard;
|
|
end.
|