summaryrefslogtreecommitdiff
path: root/fpcsrc/tests/webtbs/tw2377.pp
blob: 471c665674d1061fe692b5788bf014207030f418 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{ %cpu=i386 }
{ Source provided for Free Pascal Bug Report 2377 }
{ Submitted by "Christian Keck" on  2003-02-12 }
{ e-mail: c.keck@gmx.net }
program testkey;

uses keyboard;

var Key : TkeyEvent;
    i,j : longint;
begin
  { InitKeyBoard; }
  i:=0;
  j:=0;
  repeat
  begin
    if PollKeyEvent <> 0 then
    begin
      Key:= GetKeyEvent;
      Key:= TranslateKeyEvent(Key);
      writeln (ord(GetKeyEventChar(Key)));
      inc(j);
    end;
    inc(i);
  end;
  until i=50;
  if j<>0 then
    begin
      Writeln('Keyboard unit generates events without being started');
      halt(1);
    end;
  DoneKeyBoard;
end.