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"

Mailing lists / fpc-devel / 2005-03
5 messages · 3 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
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"
Maxim Ganetsky schrieb:
Hello,
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
Hello.
On 31 March 2005, 2:29:43 Thomas wrote:
TS> According to the unit sources there is no keypressed() function in the TS> keyboard unit, the docs are wrong (I think so at least) or it has been TS> removed.
TS> Additionally you have to initialize the keyboard unit before using it, TS> and deinitialize it afterwards manually, otherwise the keyboard methods TS> won't work.
Didn't think about it yet. First I had to compile this program :))
TS> But there's a solution, I think you can simulate the keypressed function TS> with the PollKeyEvent method as suggested in the docs:
TS> uses
TS> keyboard;
TS> function keypressed : boolean;
TS> begin
TS> keypressed := PollKeyEvent 0;
TS> end;
TS> begin
TS> InitKeyBoard();
TS> repeat
TS> until keypressed;
TS> DoneKeyBoard();
TS> end.One can also use Crt unit.
TS> Regards,
TS> Thomas
Thanks for help.
Hello. Bug 3543 has been closed as unreproducable, but I can not compile this program at…
Yes.
It compiles on Linux, but not on the other platforms.
It is my mistake; we're going to remove the KeyPressed call from the linux version of the keyboard unit.
Assume it is not there...
Michael.
According to the unit sources there is no keypressed() function in the keyboard unit, the…
No.
The docs are generated from the linux version of the units. That means all Linux functions are documented, so if there are additional functions (as in this case), they are documented.
So the documentation is always correct _for linux_.
Michael.