How do I swap left and right mouse buttons in .NET (preferably C#)? Basically the result should be the same as if the user checked the \"Switch primary and secondary buttons
You can use a Windows API call to SwapMouseButton:
using System.Runtime.InteropServices;
// ...
[DllImport("user32.dll")]
public static extern Int32 SwapMouseButton(Int32 bSwap);
// ...
// Swap it.
SwapMouseButton(1);
// Back to normal.
SwapMouseButton(0);