[fpc-devel] Bug 3543

2005-03-30 Thread Maxim Ganetsky
Hello.

Bug 3543 has been closed as unreproducable, but I can not
compile this program at least with fpc 1.9.8 on Win32:

Uses Keyboard;
begin
  repeat
  until KeyPressed;
end.

Error: Identifier not found KeyPressed

-- 
Best regards,
 Maxim mailto:[EMAIL PROTECTED]


___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel


Re: [fpc-devel] Bug 3543

2005-03-30 Thread Thomas Schatzl
Maxim Ganetsky schrieb:
Hello,
Bug 3543 has been closed as unreproducable, but I can not
compile this program at least with fpc 1.9.8 on Win32:
Uses Keyboard;
begin
  repeat
  until KeyPressed;
end.
Error: Identifier not found KeyPressed
According to the unit sources there is no keypressed() function in the 
keyboard unit, the docs are wrong (I think so at least) or it has been 
removed.
Additionally you have to initialize the keyboard unit before using it, 
and deinitialize it afterwards manually, otherwise the keyboard methods 
won't work.

But there's a solution, I think you can simulate the keypressed function 
with the PollKeyEvent method as suggested in the docs:

uses
  keyboard;
function keypressed : boolean;
begin
keypressed := PollKeyEvent  0;
end;
begin
InitKeyBoard();
repeat
until keypressed;
DoneKeyBoard();
end.
Regards,
  Thomas
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel