fix thinkpad trackpoint drift

Recently, I noticed that sometimes the trackpoint on my ThinkPad X230 (yeah, I’ll eventually get some newer hardware..) had a mind of its own. Sometimes after releasing my finger from it, the cursor would continue moving in any direction it felt like.

I began scouring forums and bug reports for an hour or so hoping for a fix. Finally, I came across this post on the superuser StackExchange site. This comment in particular pointed out that a drift_time parameter exists, so I started playing around with it.

The default value of /sys/devices/platform/i8042/serio1/drift_time for me on the 5.10 kernel (Fedora 33) was 5. To my understanding, this means that if the trackpoint stops moving or stays in the same position for 0.5 seconds, it will recalibrate that position as zero. This isn’t great since sometimes the trackpoint is held in the same position for longer.

I started to play around with a lot of different values, and for some reason, 27 (2.7 seconds) felt ‘right’.

So all you need to do is:

echo 27 | sudo tee sys/devices/platform/i8042/serio1/drift_time

and we’re done! ..right?

Wrong, go ahead and give your laptop a nice little reboot. I’m sure the kernel won’t mind that you touched that file.

No worries, if we want this to persist, we can simply use udev rules to assure us that the value we specified for drift_time will always be applied on boot.

Place the following in /etc/udev/rules.d/20-trackpoint.rules:

KERNEL=="serio1", SUBSYSTEM=="serio", DRIVERS=="psmouse", ATTR{drift_time}="27"

Lastly, be sure to check out this article for quick udev into. Rules can be defined on all sorts of device events, happy hacking!