Set up Gaming Mouse

From LQWiki
Jump to navigation Jump to search

This HowTo will be using the following setup as an example. Please feel free to customize these suggestions for your own setup.

Linux Mint 17.2 AMD64 with MATE Logitech G502 Proteus Core laser gaming mouse

The following page will be referenced relative to xinput commands: http://www.x.org/wiki/Development/Documentation/PointerAcceleration/

If you've bought a nice gaming mouse and found that your pointer is suddenly uncontrollably fast, regardless of what you do with your desktop environment's GUI controls, then you probably have a problem with acceleration and velocity scaling. In other words, your Linux desktop environment is expecting the mouse to report movement relatively slowly, and is instead getting reports extremely quickly. This causes a little physical movement to be interpreted as a lot of movement, making the pointer zip across the screen at an unusable rate. Also, acceleration can be an issue. Acceleration causes the mouse input software to speed up the pointer after it starts moving, after a brief delay, so that when you move the mouse a little bit, you have accuracy, but when you move it more, it can quickly move to other parts of your desktop without you having to physically move it around a lot. This is great for most mice, but not for gaming mice. It's worth noting that using "constant deceleration" is not a satisfactory workaround, since the polling rate is so high that it won't have an appreciable effect.

Before we get into the "meat" of it, you need to figure out how xinput identifies your mouse. Type this into a terminal window:

xinput --list

Look for something that seems to be your mouse. If you have two entries for your mouse, pick the top one (and if that doesn't work, try the others). Notice that there's a column that says, "id=x", where "x" is some number. That's your mouse's identifier. In the below commands, whenever you see "--set prop 8", change the "8" to whatever your mouse's identifier is.

There are basically two xinput commands you need (typed into a terminal window) in order to fix this. First, select the "no acceleration" profile, like so:

xinput --set-prop 8 "Device Accel Profile" 6

You can find a description of what this does at the above link, under "AccelerationProfile".

Next, we'll tell your graphical environment to expect a whole lot of updates, really fast, and compensate accordingly:

xinput --set-prop 8 "Device Accel Velocity Scaling" .04

The above link explains this under "Reporting Rate". ".04" is, as you might expect, representative of a ridiculously high polling rate. Other documents will suggest a value like "14" (yes, without a decimal point). Play around with this until your mouse works the way you like it to. Once this value is set appropriately, you can then go into your GUI configuration and play with mouse speed settings. Note that acceleration is turned off, so some settings might not do anything.

So, now your mouse is working right! Great! Wait...why doesn't it work after a reboot? Because you need a startup script, silly! Let's make sure that your computer runs these commands every time you boot up.

IMPORTANT: These instructions are for Ubuntu/Mint. They may or may not work with other distributions, so please read up on how your distribution handles startup scripts before proceeding.

Open a terminal and create a new text file in the appropriate directory, as root. nano is being used in this example, but any text editor will do.

sudo nano /etc/init.d/mousefix

Put the following in that file and save it:

#!/bin/sh
xinput --set-prop 8 "Device Accel Profile" 6
xinput --set-prop 8 "Device Accel Velocity Scaling" .04

Then, make the file executable:

sudo chmod +x /etc/init.d/mousefix

Finally, make it run at boot:

sudo update-rc.d mousefix defaults 99

There you go! If all has gone according to plan, your new mouse is working as intended. Happy gaming!