As mivk mentioned, this is straight forward and working like a charm. This is what mivk mentioned
Make a text file which you can call swapmouse.cs, containing this:
using System.Runtime.InteropServices;
using System;
class SwapMouse
{
[DllImport("user32.dll")]
public static extern Int32 SwapMouseButton(Int32 bSwap);
static void Main(string[] args)
{
int rightButtonIsAlreadyPrimary = SwapMouseButton(1);
if (rightButtonIsAlreadyPrimary != 0)
{
SwapMouseButton(0); // Make the left mousebutton primary
}
}
}
And compile it to swapmouse.exe with this command:
"%SystemRoot%\Microsoft.NET\Framework64\v3.5\csc" swapmouse.cs
Now you may create a folder called C:\Program Files\swapmouse and copy the swapmouse.exe to the newly created folder.
Now create a shortcut for this swapmouse.exe file on your desktop.
Under the property of the shortcut file, add a shortcut key, in this case, I used "Ctrl + Alt + S" and apply.
Now everytime you press "Ctrl + Alt + S" the mouse button will be swapped.
There is no dependency on the mouse to change the mouse button anymore.
3To start the exe by a keyboard shortcut:
1. Right-click on the exe and select "Create Shortcut" 2. Move the shortcut to "C:\ProgramData\Microsoft\Windows\Start Menu" or the desktop 3. Right click on the shortcut, go to the Shorcut tab and select a shortcut key
– Rad – 2016-11-21T16:07:06.930