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?)


8 comments:

  1. Very helpful information. I have the same hardware and OS and my buttons were numerically defaulted the exact same way that yours were. I spend some time being a bit frustrated when arbitrarily assigning bindings to try and figure out what the button numbering scheme was.
    This was after I realized that the "Map Buttons" option in Ubuntu's Wacom Tablet Settings GUI doesn't work with this tablet. I was unable to assign any bindings at all in the GUI. Hopefully this bug will be ironed out so others won't have to necessarily go this route.
    Thanks for taking the time to post this, it was reassuring to know that I wasn't the only one whose tablet buttons didn't work out-of-box.

    ReplyDelete
  2. The mappings for all supported tablets can be found in the /usr/share/libwacom/ directory. There are text files in the main directory that use a *.tablet extension naming convention. The buttons for the Intuos Pro are designated with alphabetical labels where A=Button 1, B=Button 2, etc.
    The subdirectory located in /usr/share/libwacom/layouts/ contains vector image files that display a graphical depictions of the tablets and the button assignments. These *.svg files should be opened with Inkscape or another application capable of displaying scalable vector graphics files.
    For more on Libwacom:
    http://linuxwacom.sourceforge.net/wiki/index.php/Libwacom

    ReplyDelete
  3. I have the same setup as you have.
    How can you set different settings for the ring ? (see 4 LED's)

    Thanks

    Cotcot

    ReplyDelete
  4. I never figured that one out, Cotcot.
    I also haven't been able to get the eraser to work on the pen.

    As far as mode switching goes, clicking on the center button will toggle my LED lights, though there is no change in function of the device for any given illuminated LED.

    I have only looked into it again after you posted. But after several different attempts, including completely uninstalling all drivers, disabling my xsetwacom script and starting from scratch, I'm still left with partial functionality.

    The thing that irks me the most is that the darn GUI for key mappings in System Settings>Wacom Tablet does nothing. It has an option to utilize the mode switching feature, but since it won't even let me assign a key to a button, it's worthless.

    I'll let you know if I figure anything out if you'll do the same!

    ReplyDelete
  5. Is it possible to map express keys as a combination of commands? For example "ctrl + z" ??

    ReplyDelete
    Replies
    1. Yes, instead of key "ctrl" just type key "ctrl z"

      Delete
  6. I couldn't get the settings thing to assign a key either - until I tried clicking in the space to the right, after selecting the button, and it worked!
    I also tried pressing two keys together, and both were assigned as a combination, eg ctrl-z or ctrl+alt.
    Then I tried putting in keys for zooming on the ring, that was fine too.
    What I can't do yet is get the lights to change when pressing the ring button, and also getting different configurations set up for different progs.

    ReplyDelete