Re: [Lazarus] key press in graphics

2014-01-26 Thread Sven Barth
Am 26.01.2014 15:23 schrieb JIMB wand...@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
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] key press in graphics

2014-01-26 Thread duilio foschi
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 wand...@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?



 Best wishes,



 Jim


 --
 ___
 Lazarus mailing list
 Lazarus@lists.lazarus.freepascal.org
 http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] key press in graphics

2014-01-26 Thread Hans-Peter Diettrich

JIMB schrieb:

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. 


Nowadays you can use a Form with a PaintBox for drawings, in Delphi or 
Lazarus.


DoDi


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus