Skip to content

Instantly share code, notes, and snippets.

@fschutt
Created December 24, 2017 13:55
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save fschutt/8c63a64e0c1c91451c7ce69142f7dfcd to your computer and use it in GitHub Desktop.
Save fschutt/8c63a64e0c1c91451c7ce69142f7dfcd to your computer and use it in GitHub Desktop.
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.
Copy link

ghost 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
Copy link
Author

fschutt commented Feb 24, 2020

No, sorry.

@hajin-chung
Copy link

hajin-chung commented Apr 5, 2023

Thanks this solved my problem. I was searching for like 10 hours thank you so much. It's so good to have scrollinggggg

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