LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to determine mouse button state?

Is there any way to determine the current state of the mouse buttons?

Mouse Events flag the transitions but I'm looking for something that will tell me, at any given time, "the button is down now" or "the button is not down now".

Yes, a specific event monitoring loop could be built to gather this information and make it globally available but all the monitoring loops I've tried have a small window of vulnerability when switching from looking for up(down) events to looking for down(up) events where they can miss event transitions, leading to incorrect state data.

I was hoping someone could point me at an intrinsic function or property somewhere.
0 Kudos
Message 1 of 3
(2,985 Views)
Hi Warren

Have a look in the Input Device Control palette under the Advanced palette. You can create a mouse object and then query the button states with Query Input Devices.vi

I hope this helps.
Kurt Friday
www.sciware.com.au
Message 2 of 3
(2,982 Views)
Thanks Kurt, that works for me.

FWIW, I've attached a LV 7.0 example of its use.
Message 3 of 3
(2,960 Views)