teaching machines

Disabling Touch and Stylus Button on Wacom Tablet in Linux

February 9, 2013 by . Filed under code, public.

I’ve got a Wacom Bamboo tablet that I use for drawing during recorded lectures. The stylus works great, but the tablet also responds to my fingers. Touch events were firing at all the wrong times, so I disabled them. The xsetwacom utility came to the rescue:

xsetwacom set $(xsetwacom --list devices | grep TOUCH | sed -n 's/.*id: \([0-9]\+\).*/\1/p') touch off

When I plug the tablet in, each input mechanism (stylus, touch, etc.) gets its own device identifier. The subcommand in the line above gets the identifier for the touch mechanism, which becomes the parameter for xsetwacom’s set command. We turn that device off.

I also found myself accidentally pressing the rocker button on the stylus, which either opens open a context menu (a right-click) or drags my canvas around when combined with a sweep of the stylus (a left-click and drag). To disable the button, I employ these two lines:

xsetwacom set $(xsetwacom --list devices | grep STYLUS | sed -n 's/.*id: \([0-9]\+\).*/\1/p') Button 2 0
xsetwacom set $(xsetwacom --list devices | grep STYLUS | sed -n 's/.*id: \([0-9]\+\).*/\1/p') Button 3 0