Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / January 2006

Tip: Looking for answers? Try searching our database.

How to know if mouse buttons are switched ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Herve Bocuse - 05 Jan 2006 19:53 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.