08-11-2011 09:36 PM
Hello
I recently upgraded from LabVIEW 7 to the 2010 version and I also migrated from using a PC to a Mac (OS X). I am having some difficulty finding how I can read a mouse to determine whether the left/right button was clicked - this was something that was done easily on the PC/earlier version but I can't seem to find the appropriate functions.
Any help/suggestions would be much appreciated.
Thanks,
Solved! Go to Solution.
08-12-2011 07:39 AM
Hi Michmar,
You should be able to acomplish this by using an event structure with the source configured as Panes>Pane>MouseDown. I have put together an example vi in 2010 (attached) that should hopefully help you with this.
Let me know how you get on.
All the best!
08-12-2011 08:09 AM
Michmar,
As far as I know the Mac OS only recognizes one mouse button. When you use another mouse/trackball with multiple buttons, you must use a driver provided by the device manufacturer to distinguish various buttons. The code Paul H provided will count clicks but does not appear to distinguish between buttons. I have a Kensington trackball with 4 buttons. One is set to click, another to double click. The double click button records two counts in Paul H.'s VI. When I set one button to right click the VI records one count. One buttonis set to drag. The VI records one count for every other click.
In the Platform Folder of vi.lib is a Mac Mouse Buttons Down.vi. This produces an array of booleans. It does distinguish the right click! Boolean 0 is true for any of the click, double click, and drag functions, but Boolean 1 goes true for right click.
So, it looks like NI provided what you need. There is no help file for that VI, so no explanation of what buttons produce what outputs. Experiment!
Lynn
08-15-2011 03:52 AM
Thanks johnsold, that's interesting to know as I have not specifically worked with the Mac OS myself.
Let us know how you get on Michmar.
08-17-2011 09:22 AM
Hi Lynn
Thanks very much for that - that was exactly what I needed! I am now able to distinguish button presses. Hooray!
Cheers,
Michelle