Saturday, February 7, 2015

How to configure Wacom Intuos Express Keys on Linux

I have a Wacom Intuos Pro Medium Pen Tablet (or digitizer) PTH-651 and had some trouble assigning the buttons (or "express keys") on Ubuntu Linux 14.04 LTS.

Finally I got it working so here is my solution, using xsetwacom. It's in the official Ubuntu repositories so you can install it from there.

Getting to know your device names, parameters you can set and modifiers you can set them to.

First off, you'll need to know how Ubuntu calls your Intuos. You can do this with the following command (in a terminal window):
xsetwacom --list devices
In my case the result is:
Wacom Intuos Pro M Pen stylus   id: 14 type: STYLUS  
Wacom Intuos Pro M Pen eraser   id: 15 type: ERASER  
Wacom Intuos Pro M Pen cursor   id: 16 type: CURSOR  
Wacom Intuos Pro M Pen pad       id: 17 type: PAD    
Wacom Intuos Pro M Finger touch id: 18 type: TOUCH
Then you'll need to know what kind of buttons and other stuff you can configure using xsetwacom. The following command:
xsetwacom --list parameters
gives you a long list of parameters you can use, with a brief explanation of what they mean. The parameter "Button" for instance will be used to assign a key to a button (or "express key" as Wacom calls it).

Lastly, you kneed to know what you can set these parameters to. The following command:
xsetwacom  --list modifiers
gives you the list of modifiers (keys really) you can set the parameters to. The modifier "PgDn" for instance will be used to set a button ("express key") to act as if you press the "PageDown" button on your keyboard.

Configuring your buttons ("express keys")

The "general" command for assigning a key to a button on my Wacom Intuos Pro is the following:
xsetwacom set "Wacom Intuos Pro M Pen pad" Button 2 key "b"
The above command would set "button 2" of my Intuos to the key "b".

Seems simple enough, and it is really, except for the fact that the numbers of the buttons aren't really logical. To make a long story short, after a lot of trial and error I found that my buttons are numbered, from top to bottom:
2
3
8
9

1 (the big button in the middle of the Touch Ring)

10
11
12
13

In case they don't correspond for you, here's how I found them:

  • open a terminal window
  • type or copy/paste the following command:
xsetwacom set "Wacom Intuos Pro M Pen pad" Button 2 key "b"
  • open a simple text editor like mousepad or gedit
  • instead of typing, push the buttons on your Wacom Intuos and see what happens in the text editor. The button that types "b" is button number 2.
  • Now continue doing the same for the other buttons. Just change the button number in the above command (from 2 to 3 for instance) and push again all the buttons (except for the ones you found already of course).
Finally, as an example, I configure my buttons ("express keys") as follows:
xsetwacom set "Wacom Intuos Pro M Pen pad" Button 2 key "shift"
xsetwacom set "Wacom Intuos Pro M Pen pad" Button 3 key "ctrl"
xsetwacom set "Wacom Intuos Pro M Pen pad" Button 8 key "alt"
xsetwacom set "Wacom Intuos Pro M Pen pad" Button 9 key "esc"
xsetwacom set "Wacom Intuos Pro M Pen pad" Button 10 key "pgup"
xsetwacom set "Wacom Intuos Pro M Pen pad" Button 11 key "pgdn"
xsetwacom set "Wacom Intuos Pro M Pen pad" Button 12 key F1
xsetwacom set "Wacom Intuos Pro M Pen pad" Button 13 key F2

Configuring the Touch Ring

Now you got the hang of it, the Touch Ring is a piece of cake. Just replace "Button 2" with "AbsWheelUp" and "AbsWheelDown" (one for each direction) and you're good.
In my case, I use:
xsetwacom set "Wacom Intuos Pro M Pen pad" AbsWheelUp key "="
xsetwacom set "Wacom Intuos Pro M Pen pad" AbsWheelDown button 7
Now if you pay attention, the modifiers I chose seem a bit weird, right? Why would I use "7" to zoom out and "=" to zoom in? Here's where it gets goofy. I have an AZERTY keyboard (be-fr) and xsetwacom doesn't seem to like that a lot. It actually treats it as if it were a QWERTY keyboard, but not completely either. So I had a lot of trial-and-error fun, again, trying to figure out how xsetwacom interprets the keys on my keyboard. I didn't actually work it out, I stumbled by chance on the right keys for the zoom and left it at that.

Turning off touch

To turn off the "touch" reactivity of my tablet, I use the following command:
xsetwacom --set "Wacom Intuos Pro M Finger touch" touch "off"

A note on Inkscape and pressure sensitivity

I couldn't get pressure sensitivity working on Inkscape. Seems to be a bug in overlay-scrollbar finally. Apparently you can get around it by starting inkscape as follows from command line:
LIBOVERLAY_SCROLLBAR=0 inkscape
but that didn't (always) seem to work for me.
Finally I just removed the package "oevrlay-scrollbar" from Ubuntu. Pressure sensitivity works fine now.

Using your newly configured buttons

To use your buttons with the xsetwacom configurations, you need to first plug in your Intuos (otherwise the device name will be unrecognized by xsetwacom) and then, in a terminal, type your xsetwacom commands. The settings are lost at reboot.

If you don't like hassle, like me, you can just make a small text file where you keep the commands. If you put them all in a single line, separated by "&&" (see axample below), you can issue it as one long command.

I my case, the final command is:

xsetwacom set "Wacom Intuos Pro M Pen pad" AbsWheelUp key "=" && xsetwacom set "Wacom Intuos Pro M Pen pad" AbsWheelDown button 7 && xsetwacom set "Wacom Intuos Pro M Pen pad" Button 2 key "shift" && xsetwacom set "Wacom Intuos Pro M Pen pad" Button 3 key "ctrl" && xsetwacom set "Wacom Intuos Pro M Pen pad" Button 8 key "alt" && xsetwacom set "Wacom Intuos Pro M Pen pad" Button 9 key "esc" &&
xsetwacom set "Wacom Intuos Pro M Pen pad" Button 10 key "pgup" &&
xsetwacom set "Wacom Intuos Pro M Pen pad" Button 11 key "pgdn" &&
xsetwacom set "Wacom Intuos Pro M Pen pad" Button 12 key F1 &&
xsetwacom set "Wacom Intuos Pro M Pen pad" Button 13 key F2

Or you can make a shell script, of course. You can find all about that in the linuxwacom Tablet configuratio Wiki.

Good luck and have a nice day!



If you appreciated this article for some reason or another, please share it (see the buttons below), and, of course, don't forget to Flattr! (Why?)