09-11-2014 01:17 AM
Hi all!
In the Windows Settings for the mouse, MS call the mouse buttons "Primary" and "Secondary" button. The primary button is the one you would normaly use with your index finger. On a right handed mouse it is the left button, on a left handed mouse it's the right button. Windows interchanges the buttons when the "Change primary and secondary button" option in the mouse settings are choosen.
But how do I manage this in CVI? CVI has only EVENT_RIGHT_CLICK and EVENT_LEFT_CLICK. It doesn't take care of the windows settings. I like to have a kind of context menu on some controls but how can I know about the mouse settings?
Best regards,
Thomas
Solved! Go to Solution.
09-11-2014 01:31 AM - edited 09-11-2014 01:32 AM
Hello Thomas!
When the meaning of the mouse buttons are swapped (i.e. the primary button is swapped with the secondary button), LabWindows/CVI also sends the corresponding EVENT_RIGHT_CLICK or EVEN_LEFT_CLICK, according to the newly assigned meaning of each mouse button. For example, if the primary mouse button has been replaced by the secondary mouse button, when the user clicks that mouse button, CVI sends an EVENT_RIGHT_CLICK instead of a the EVENT_LEFT_CLICK.
However, you can use the User32.dll SwapMouseButton function in order to change the meaning of the mouse buttons, or to determine the meaning, in case the user has previously modified the meaning from the Mouse Windows dialog.
I hope this helps!
- Johannes