I use a MS keyboard on my Debian machine. The problem is that MS does not ship configuration software for us and touchpad’s default scrolling directions are reversed (it uses natural scrolling).
I wonder if it’s possible to tweak the input from the particular input device somehow so it behaves “normally”. I.e. I would like to replace scroll-up and scroll-down commands.
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
You can control some settings of input devices with xinput. Run xinput list to list devices. Each device has a name and a numerical ID. You can use either this name or this ID to list properties of the corresponding device. Device IDs can depend on the order in which the devices are detected, so to target a specific device, use its name. For example, I have a mouse as device 8; here’s an excerpt of its properties:
$ xinput list-props 8
…
Evdev Axis Inversion (272): 0, 0
Evdev Axes Swap (274): 0
…
Either of the following commands makes my cursor go right when I move my mouse left, and up when I move it down:
xinput set-prop 8 272 1 1 xinput set-prop 8 'Evdev Axis Inversion' 1 1
If you want to swap the direction of wheel emulation, there are properties for that: change Evdev Wheel Emulation Axes from 6 7 4 5 to 7 6 5 4.
Method 2
After a kind pointing by @Gilles to xinput I was able to swap scroll directions by using the set-button-map command.
First you should lookup the device id or name using the list command and then remap scroll wheel buttons like this xinput set-button-map id 1 2 3 5 4 7 6.
Published a small script which does this automatically.
Method 3
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
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0