Skip to content

Instantly share code, notes, and snippets.

@fschutt

fschutt/solution.txt

Created Dec 24, 2017
Embed
What would you like to do?
How to enable two-finger scrolling using xinput (ThinkPad T420)
I can't say that this will work for everyone, but here's what I did:
First, list the input devices:
xinput list
You should get output like this:
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ SynPS/2 Synaptics TouchPad id=11 [slave pointer (2)]
⎜ ↳ TPPS/2 IBM TrackPoint id=12 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Video Bus id=7 [slave keyboard (3)]
↳ Sleep Button id=8 [slave keyboard (3)]
↳ Integrated Camera id=9 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=10 [slave keyboard (3)]
↳ ThinkPad Extra Buttons id=13 [slave keyboard (3)]
The correct ID is 11 - the "SynPS/2 Synaptics TouchPad". Note that number. Now do:
xinput list-props 11
(where 11 is your device number). Should result in something like this:
Device 'SynPS/2 Synaptics TouchPad':
Device Enabled (137): 1
Coordinate Transformation Matrix (139): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Tapping Enabled (276): 1
libinput Tapping Enabled Default (277): 0
libinput Tapping Drag Enabled (278): 1
libinput Tapping Drag Enabled Default (279): 1
libinput Tapping Drag Lock Enabled (280): 0
libinput Tapping Drag Lock Enabled Default (281): 0
libinput Tapping Button Mapping Enabled (282): 1, 0
libinput Tapping Button Mapping Default (283): 1, 0
libinput Accel Speed (284): 0.000000
libinput Accel Speed Default (285): 0.000000
libinput Natural Scrolling Enabled (286): 0
libinput Natural Scrolling Enabled Default (287): 0
libinput Send Events Modes Available (261): 1, 1
libinput Send Events Mode Enabled (262): 0, 0
libinput Send Events Mode Enabled Default (263): 0, 0
libinput Left Handed Enabled (288): 0
libinput Left Handed Enabled Default (289): 0
libinput Scroll Methods Available (290): 1, 1, 0
libinput Scroll Method Enabled (291): 0, 1, 0
libinput Scroll Method Enabled Default (292): 1, 1, 0
libinput Disable While Typing Enabled (293): 1
libinput Disable While Typing Enabled Default (294): 1
Device Node (264): "/dev/input/event5"
Device Product ID (265): 2, 7
libinput Drag Lock Buttons (295): <no items>
libinput Horizontal Scroll Enabled (296): 1
Note the number on the line with "Scroll Method Enabled". In my case, it's "291".
Now that we have those two numbers, we can enable the vertical scrolling:
xinput set-prop 11 291 1 0 0
The last numbers are three booleans, only one of them can be set to 1 at a time, two have to be set to 0.
The booleans are (in order): "two-finger", "edge", "button" - indicate which scroll method is
currently enabled on this device.
So to enable two-finger scrolling, you have to set them to "1, 0, 0".
That's it. It worked for me, not 100% sure if it'll work for you.
@energeticsky

This comment has been minimized.

Copy link

@energeticsky energeticsky commented Feb 24, 2020

Hi thanks for posting! I have been trying to get 2 finger scrolling working with an apple magic trackpad on a raspberry pi. I get an error when I try this method. I noticed that for my trackpad it says "libinput Scroll Methods Available (267): 0, 0, 1". So Im guesing this means two-finger scroll is not available? Any idea how to make it available?

@fschutt

This comment has been minimized.

Copy link
Owner Author

@fschutt fschutt commented Feb 24, 2020

No, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment