mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-26 20:03:49 +02:00
25 lines
483 B
ObjectPascal
25 lines
483 B
ObjectPascal
program example9;
|
|
|
|
{ This program demonstrates the logkeys unit }
|
|
|
|
uses keyboard,logkeys;
|
|
|
|
Var
|
|
K : TKeyEvent;
|
|
|
|
begin
|
|
InitKeyBoard;
|
|
Writeln('Press keys, press "q" to end, "s" toggles logging.');
|
|
Repeat
|
|
K:=GetKeyEvent;
|
|
K:=TranslateKeyEvent(K);
|
|
Writeln('Got key : ',KeyEventToString(K));
|
|
if GetKeyEventChar(K)='s' then
|
|
if IsKeyLogging then
|
|
StopKeyLogging
|
|
else
|
|
StartKeyLogging;
|
|
Until (GetKeyEventChar(K)='q');
|
|
DoneKeyBoard;
|
|
end.
|