summaryrefslogtreecommitdiff
path: root/fpcdocs/kbdex/ex7.pp
blob: 88e2963555a8288ee5eab41c5853e35fcceee62b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
program example1;

{ This program demonstrates the GetKeyEvent function }

uses keyboard;

Var
  K : TKeyEvent;

begin
  InitKeyBoard;
  Writeln('Press keys, press "q" to end.');
  Repeat
    K:=GetKeyEvent;
    K:=TranslateKeyEvent(K);
    If IsFunctionKey(K) then
      Writeln('Got function key : ',KeyEventToString(K))
    else
      Writeln('not a function key.');
  Until (GetKeyEventChar(K)='q');
  DoneKeyBoard;
end.