[Lazarus] key press in graphics

Sven Barth pascaldragon at googlemail.com
Sun Jan 26 16:29:41 CET 2014


Am 26.01.2014 15:23 schrieb "JIMB" <wandana at ntlworld.com>:
>
> Hi,
>
> New to the group so a bit a of history..
>
>
>
> I am returning to Pascal after a long absence, I used to do mainly Pascal
and Delphi amongst others but the only languages used professionally were
GPSSH (Wolverine) and Assembler.
>
>
>
>
>
> Years ago, I wrote a program in Borland TP7 that created a graphic screen
and the user controlled activity with mouse and or key board.
>
>
>
> I “may” have written a bit of assembler to grab mouse functions but that
was on a relatively primitive PC (Win 95??)
>
>
>
> I need to do this again but cannot remember the code that grabbed the key
press or mouse click.
>
>
>
> I am running Lazarus under Windows 7
>
>
>
> Can anyone give a bit of help/advice?

Well... Then welcome to this century of programming ;)
Do you want to work a GUI or a console application? If the former then you
should take a look at the OnKeyPress/-Up/-Down events of the various GUI
components. For a console application you should look at the Mouse and
Keyboard units which abstract mouse and keyboard access in a platform
independent way. Using assembler to access keyboard and mouse is not
possible on any modern OS.

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20140126/4337cd8c/attachment-0003.html>


More information about the Lazarus mailing list