LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

EVENT_RIGHT_CLICK on a left handed mouse

Solved!
Go to solution

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

0 Kudos
Message 1 of 2
(4,548 Views)
Solution
Accepted by topic author Thosch

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

0 Kudos
Message 2 of 2
(4,543 Views)