Lenovo / IBM Scrollpoint Mouse with Smooth & Horizontal Scrolling in Linux

Lenovo Scrollpoint Mouse
IBM Scrollpoint Mouse“, by Lenovo
After all these years (over 10), I finally stumbled upon a Linux driver for my IBM Scrollpoint Mouse that actually supports horizontal scrolling – BOOYAH!!!!!!! 😀  I’ve had this beautiful little mouse with the glowing blue scroll button for years and had it fully working under Linux EXCEPT that I could not use the little blue, lit-up scroll pushey-thingy to scroll horizontally.  Scrolling vertically worked so-so (a bit too sensitive/jerky/fast) by default.  It appears to have three different sensitivities in the vertical axis so that if you push gently, it scrolls slowly, then speeds up as you push harder (up or down).  It’s much easier for quick scrolling than having to sit and spin a wheel hard!  Now I feel this would be the perfect mouse, if Lenovo would just make a WIRELESS version!

I had tried to pay a C-programmer friend years ago to write me a driver for it (to no avail) and even considered trying to figure out how to hack one up myself to support this, but I knew it would likely turn into a huge project with a very steep learning curve.  Besides, I really didn’t want to go to that extreme anyway.  Every few years I’ve googled around to see if anyone else had already found a way to get it to work, and today I finally got a hit!  (at https://github.com/pdewacht/hid-scrollpoint/).  It’s a kernel driver called “hid-scrollpoint”, written by Peter De Wachter.  (Thank you Mr. De Wachter!)  You’ll need to download all three files (a Makefile, a C header file, and a C source file) from the first link mentioned above, on GitHub!  You will also need to install your kernel headers to build.  NOTE:  If you don’t care about horizontal scrolling and just want smooth vertical scrolling and use of all three buttons, then just skip all this and do only steps 2 and 5 below.

1)  Put these three files in a subdirectory and then:

    $>make
    $>sudo make modules_install
    $>sudo depmod -a
    $>ls -l /lib/modules/`uname -r`/extra/hid-scrollpoint.ko

This should put the new kernel driver “hid-scrollpoint.ko” in the proper place (/lib/modules/`uname -r`/extra/) or somewhere nearby.

2)  You’ll need to create a file in /etc/X11/xorg.conf.d/ You can name it anything, but I chose: “ibm_scrollpoint.conf”.  It should contain:

    Section "InputClass"
       Identifier "ScrollPoint"
       MatchUSBID "04b3:3100|04b3:3103|04b3:3105|04b3:3108|04b3:3109"
       Option "VertScrollDelta" "16"
       Option "HorizScrollDelta" "16"
       Option "AccelerationProfile" "2"
    EndSection

I later added the optional “AccelerationProfile” line to speed up the mouse a bit when moving it fast – see http://www.x.org/wiki/Development/Documentation/PointerAcceleration/.  You can also tweak the “16” values later if you like, though these defaults seem to work very well for me.  After creating this file, or adding this section to your /etc/X11/xorg.conf, you’ll need to restart X for this to take effect.

3)  Plug in your IBM/Lenovo USB Scrollpoint mouse and do:

    $>lsmod | grep "hid"

You should see at least these three drivers (loaded in order from bottom up):

    hid_generic 907 0
    hid_scrollpoint 1168 0
    usbhid 33909 0

If not, do:

    $>lsusb

and look for a line like:

    Bus 003 Device 012: ID 04b3:3108 IBM Corp. 800dpi Optical Mouse w/ Scroll Point

If the pair of four-digit hex numbers you find there (mine are 04b3:3108, but ymmv!) isn’t in the “MatchUSBID” line you added, then modify that line to include them and restart X.  If still no go, make sure you ran “depmod -a” as root and that the file “hid-scrollpoint.ko” got installed, see if you can do a “sudo modprobe hid-scrollpoint” without error, then reboot and restart X!  If modprobe says he can’t find “hid-scrollpoint” after running “depmod -a”, reboot and try modprobe again.

4)  There’s one more issue you’ll likely run into: By default, my system likes to load the “hid_generic” module before “hid_scrollpoint”.  If that is the case for you, then you’ll see this when you run the aforementioned “lsmod” command:

    hid_scrollpoint 1168 0
    hid_generic 907 0
    usbhid 33909 0

In this case, you’ll have to find some way to force “hid_scrollpoint” to load FIRST.  I did it in my startup.  NOTE: It does NOT seem to hurt to go ahead and load both of these in the right order using “modprobe” at system startup even if the mouse is not attached at startup, ie. with a laptop / or if switching between other mice.  Also, once loaded in the proper order, they fortuitously remain loaded even after unpluging the mouse and / or switching to a different USB mouse, nor does it seem to affect my touchpad or trackpoint (I have both on my Dell Latitude D620 laptop).  After having the drivers in the right order and then starting X, both horizontal and vertical scrolling should work smoothly in applications, such as Firefox, that support it, ie. have horizontal scrollbars.  You can adjust the numerical parameters for “VertScrollDelta” and “HorizScrollDelta” to something other than “16” if you want faster / slower scrolling!  Running “xev” should also show the scroll events as buttons 4 and 5 (vertical) and 6 and 7 (horizontal)!  I also did not have to change any of Firefox’s default scrolling options.

5)  You must RESTART X or REBOOT!:

If the drivers are in the wrong order, then horizontal scrolling will not work.  Anyway, here’s my /var/log/Xorg.0.log file showing the pertinent lines and how they should look (ymmv):

[ 24191.151] (II) config/udev: Adding input device HID 04b3:3108 (/dev/input/event1)
[ 24191.151] (**) HID 04b3:3108: Applying InputClass "evdev pointer catchall"
[ 24191.151] (**) HID 04b3:3108: Applying InputClass "ScrollPoint"
[ 24191.151] (II) Using input driver 'evdev' for 'HID 04b3:3108'
[ 24191.151] (**) HID 04b3:3108: always reports core events
[ 24191.151] (**) evdev: HID 04b3:3108: Device: "/dev/input/event1"
[ 24191.202] (--) evdev: HID 04b3:3108: Vendor 0x4b3 Product 0x3108
[ 24191.202] (--) evdev: HID 04b3:3108: Found 3 mouse buttons
[ 24191.202] (--) evdev: HID 04b3:3108: Found scroll wheel(s)
[ 24191.202] (--) evdev: HID 04b3:3108: Found relative axes
[ 24191.202] (--) evdev: HID 04b3:3108: Found x and y relative axes
[ 24191.202] (II) evdev: HID 04b3:3108: Configuring as mouse
[ 24191.202] (II) evdev: HID 04b3:3108: Adding scrollwheel support
[ 24191.202] (**) Option "VertScrollDelta" "16"
[ 24191.202] (**) Option "HorizScrollDelta" "16"
[ 24191.202] (**) evdev: HID 04b3:3108: YAxisMapping: buttons 4 and 5
[ 24191.202] (**) evdev: HID 04b3:3108: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[ 24191.202] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:1d.7/usb3/3-8/3-8.2/3-8.2.2/3-8.2.2:1.0/0003:04B3:3108.0008/input/input20/event1"
[ 24191.202] (II) XINPUT: Adding extended input device "HID 04b3:3108" (type: MOUSE, id 9)
[ 24191.202] (II) evdev: HID 04b3:3108: initialized for relative axes.
[ 24191.203] (**) HID 04b3:3108: (accel) keeping acceleration scheme 1
[ 24191.203] (**) Option "AccelerationProfile" "2"
[ 24191.203] (**) HID 04b3:3108: (accel) acceleration profile 2
[ 24191.203] (**) HID 04b3:3108: (accel) acceleration factor: 2.000
[ 24191.203] (**) HID 04b3:3108: (accel) acceleration threshold: 4
[ 24191.204] (II) config/udev: Adding input device HID 04b3:3108 (/dev/input/mouse0)
[ 24191.204] (**) HID 04b3:3108: Applying InputClass "ScrollPoint"

UPDATE NOTE:  If you upgrade your kernel (and headers) the horizontal scrolling will quit after rebooting!  You’ll need to do the following once, the first time after upgrading and rebooting:

    Repeat Step 1 above.
    Reboot -OR- do the following:
    Unplug the mouse.
    $>sudo rmmod hid_generic
    $>sudo modprobe hid_scrollpoint
    $>sudo modprobe hid_generic
    Plug the mouse back in.
    Restart X

Advertisements

One Comment

  1. Posted December 30, 2016 at 12:26 pm | Permalink | Reply

    UPDATE: To make this module “persistant” across kernel upgrades, do the following (one time):

    $>cd /usr/src
    $>mkdir hid-scrollpoint-1.00
    $>cp /home/turnerjw/scrollpoint/* hid-scrollpoint-1.00
    $>cd hid-scrollpoint-1.00/
    $>touch dkms.conf
    $>vi dkms.conf
    ================================
    PACKAGE_NAME=”hid-scrollpoint”
    PACKAGE_VERSION=”1.00″
    BUILT_MODULE_NAME[0]=”hid-scrollpoint”
    DEST_MODULE_LOCATION[0]=”/kernel/drivers/hid/”
    AUTOINSTALL=”yes”
    ================================

    $>dkms add -m hid-scrollpoint -v 1.00

    Creating symlink /var/lib/dkms/hid-scrollpoint/1.00/source ->
    /usr/src/hid-scrollpoint-1.00

    DKMS: add completed.

    $>dkms build -m hid-scrollpoint -v 1.00

    Kernel preparation unnecessary for this kernel. Skipping…

    Building module:
    cleaning build area…
    make -j4 KERNELRELEASE=4.8.0-10.1-liquorix-686-pae -C /lib/modules/4.8.0-10.1-liquorix-686-pae/build M=/var/lib/dkms/hid-scrollpoint/1.00/build….
    cleaning build area…

    DKMS: build completed.

    $>dkms install -m hid-scrollpoint -v 1.00

    hid-scrollpoint:
    Running module version sanity check.
    – Original module
    – Found /lib/modules/4.8.0-10.1-liquorix-686-pae/extra/hid-scrollpoint.ko
    – Storing in /var/lib/dkms/hid-scrollpoint/original_module/4.8.0-10.1-liquorix-686-pae/i686/
    – Archiving for uninstallation purposes
    – Installation
    – Installing to /lib/modules/4.8.0-10.1-liquorix-686-pae/kernel/drivers/hid//

    depmod…..

    DKMS: install completed.

Feel Free to Comment (Name/Email/Website optional):

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: