Wacom tablet middle mouse button scrolling

I wanted to enable scroll/pan actions in my wacom, like we do in Windows by pressing the mouse middle button and move the mouse to up and down. To do this:

  1. First I listed the devices using xsetwacom --list devices:
$ xsetwacom --list devices
Wacom Intuos S Pen stylus           id: 14  type: STYLUS    
Wacom Intuos S Pen eraser           id: 15  type: ERASER    
Wacom Intuos S Pen cursor           id: 16  type: CURSOR    
Wacom Intuos S Pad pad              id: 17  type: PAD
  1. Since I wanted to enable scroll/pan using the lower button in wacon pen (Button 2), I used the command below (where "pan" is the value to enable the feature in Button 2)
xsetwacom --set "Wacom Intuos S Pen stylus" Button 2 "pan"
  1. To test, go to your browser or any other document, drag the pen to up/down/left/ right while you click the pen Button 2.

  2. To increase the sensitivity, I decreased the value of "PanScrollThreshold" parameter (the default value was 1300)

xsetwacom --set "Wacom Intuos S Pen stylus" "PanScrollThreshold" 200

References:

  • http://manpages.ubuntu.com/manpages/bionic/man1/xsetwacom.1.html
  • http://manpages.ubuntu.com/manpages/bionic/man4/wacom.4.html

As a fellow owner of Wacom tablet, I decided to make an autoscrolling utility. It works only on X11-based desktop environments (so no Wayland + Gnome).

Example config:

# Use `xinput list` to get device list. Wacom Bamboo registers 4
# devices. The relevant one is called "Wacom Bamboo Pen stylus". But
# there is nothing wrong with grabbing all 4 of them, which is why I use
# "Wacom" filter to catch them all. `_grep` part comes from the fact
# that the program is just running `xinput list | grep ${xinput_grep}`.
xinput_grep = "Wacom"

# Windows-like auto-scrolling. Press `button_id` to start scrolling,
# then move your mouse up or down. The longer the distance between the
# cursor and the starting point, the faster you scroll. Remove/comment
# out whole section if you don't want it.
[scroll]
# `hold = false` means click once to enable, click once to disable.
# Recommended `false` on tablets, as it's annoying when you connectivity
# while using `hold = true`.
hold = false
# Scrolling speed. Has different effect on different screen resolutions.
# Recommended to set `speed` to high value and decrease system-wide
# scrolling speed as much as possible. Equation: `speed`×`distance`[px]
# ÷1_000_000_000 = emulated mouse wheel rolls.
speed = 1000000
# Which button toggles scrolling. Button 2 is the middle mouse button.
# Button 3 is upper button on Wacom Bamboo Pen.
button_id = 3