View Full Version : Delphi: Retrieving mouse info
Kaiousama
18th February 2004, 12:52
I want to check inside a OnMouseMove event if the first mouse button is pressed (while the user is moving the mouse); but OnMouseMove event only have "Shift", "X", "Y" arguments and not the "Button" argument.
Is there a way to retrieve if one mouse button is pressed?
Thanks. :)
unmei
18th February 2004, 17:32
one way you can do it is setting a flag when the user presses the button (OnMouseDown) and clearing it when he releases the butoon (OnMouseUp). then OnMouseMove you check the flag.
I'm a bit confused OnMouseMove doesnt the button ...but oh wait doesnt shift include :
ssRight The right mouse button is held down.
ssMiddle The middle mouse button is held down.
ssDouble The mouse was double-clicked.
you should probably use that one..
Kaiousama
18th February 2004, 23:08
one way you can do it is setting a flag when the user presses the button (OnMouseDown) and clearing it when he releases the butoon (OnMouseUp).
It was exactly the wark-around i've used, but surely it is not a beautiful way.
I'm a bit confused OnMouseMove doesnt the button ...but oh wait doesnt shift include : you should probably use that one..
Yessssss, it's exactly what i'm looking for, i'll test it tomorrow! Thanks Unmei!
Please tell me you haven't found it in Delphi Help (in that case i feel really n00b because i searched a lot in it) :p
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.