In the mouse control panel it is possible for a user to switch the
mouse buttons.
How to programmatically check this ? I need this to know if I have to
fire a left or right mouse button with the mouse_event win32 function.
Thank you
Nicolas
Mattias Sjögren - 05 Jan 2006 20:24 GMT
>How to programmatically check this ?
I don't know if the information is available from any managed class,
but you can check it with GetSystemMetrics(SM_SWAPBUTTON).
Mattias

Signature
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Morten Wennevik - 05 Jan 2006 20:24 GMT
Hi Nicolas,
If the buttons are switched, the left mouse button will send MouseButtons.Right and the right button will be MouseButtons.Left so your application should work properly either configuration.
If you really need to know which configurations there are probably some registry key you could check for or use SwapMouseButton from the User32.dll. The return value will tell if the buttons were swapped to begin with.
> In the mouse control panel it is possible for a user to switch the
> mouse buttons.
[quoted text clipped - 4 lines]
>
> Nicolas

Signature
Happy coding!
Morten Wennevik [C# MVP]
Herve Bocuse - 05 Jan 2006 21:02 GMT
Sorry, got it:
SystemInformation.MouseButtonsSwapped
Nicolas