Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2014-01

key press in graphics

4 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

JIMB

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?

Best wishes,

Jim

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140126/f0cb7bf9/attachment.html>

Reply by email

Sven Barth
to JIMB
"JIMB" wrote 8 lines
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.

Show quoted text 6 lines
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.

Show quoted text 8 lines
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.freepascal.org/pipermail/lazarus/attachments/20140126/4337cd8c/attachment.html>

Reply by email

duilio foschi
to JIMB: New to the group so a bit a of history.. I am returning to Pascal after a long absence, I…

Hi Jim,

it is not clear to me if you want to write a windows application or a console application.

In the 1st case, you mostly use the OnKeyDown/OnKeyUp and OnMouseMove/OnMouseDown/OnMouseUp events of the form.

For the 2nd case, you could find useful infos here (originally for Delphi): http://stackoverflow.com/questions/5845080/how-i-can-implement-a-iskeypressed-function-in-a-delphi-console-application

You may find this free library helpful:
http://sourceforge.net/projects/graphics32

HTH

Duilio

2014/1/26 JIMB :

Show quoted text 50 lines
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? Best wishes, Jim -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email