Like some others, I’ve started to get issues with the mouse button configuration (particularly when I tried out marksman, I’ve played ADC in League of Legends for far too long).
I didn’t like the whole reg-edit solution, since it usually requires a restart or can’t be changed while the program is open (which makes it very inconvenient when alt-tabbing or generally doing things on the side).
I’ve been fiddling around with the “change primary mouse button” setting in windows and was considering creating a mouse macro for this, but then I stumbled over an even more amazing solution:
Short version:
swapmouse.txt (3.5 KB)
- Download the attached
swapmouse.txt
- rename it to
swapmouse.exe
Long Diy version (which is also useful in case you don’t trust me):
- create a new text file
- paste the following code in
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
}
}
}
- save the file as
swapmouse.cs
(I’ve put mine into the Documents folder) - open a console (press
windows + R
, typecmd
). - Navigate to the folder you put your file in using the
cd
command. If you’ve put your file into the Documents folder, typecd Documents
, if it’s on the desktop typecd Desktop
. If you’ve put it anywhere else you probably know what you’re doing - run the following command
"%SystemRoot%\Microsoft.NET\Framework64\v3.5\csc" swapmouse.cs
This will give you a file called swapmouse.exe
. Clicking this will swap your mousebuttons on the fly. I’ve put this file as a hotkey in my mouse software (on the “change DPI” button that I’ve never used anyway).