Remapping an individual device with xinput and .xsessionrc
I had a similar issue where I wanted to reverse scrolling on one device.
The ID didn't work for me because it changed with each start up. Using the device name did work.
Type the following line in terminal to find the name of the device:
xinput list
Then use a text editor to edit or write .xsessionrc in the home directory. Example:
vim ~/.xsessionrc
Note: I recommend typing "sudo vim ~/.xsessionrc" to simplify issues with write permissions if the file already exists, as was in the initial example before review.
Then add the following line to .xsessionrc with "name" replace by "device name from xinput list". Keep the quotes.
xinput set-button-map "name" 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
For example, I wanted to reverse vertical scrolling (4 5) and horizontal scrolling (6 7) on my "Microsoft Wedge Touch Mouse".
xinput list gave me:
⎜ ↳ Microsoft Wedge Touch Mouse id=15 [slave pointer (2)]
So I added the following line to .xsessionrc
xinput set-button-map "Microsoft Wedge Touch Mouse" 1 2 3 5 4 7 6
Finally, log out and in.
This worked on Mint Cinnamon 17.3