I'm trying to bind the keys of my Wacom Intuos Pro to various handy shortcuts that I'd normally do with the keyboard.

My OS is Xubuntu 15.04 but I'm following this section of the Arch Linux wiki on xsetwacom. (I know they're different distros, but I find the Arch Wiki articles really useful for non-distro specific stuff.)

A few of these worked really well to set space panning, undo and redo:

xsetwacom --set "Wacom Intuos Pro S Pen pad" Button 1 'key +space'
xsetwacom --set "Wacom Intuos Pro S Pen pad" Button 8 'key +ctrl z -ctrl'
xsetwacom --set "Wacom Intuos Pro S Pen pad" Button 2 'key +ctrl +shift z -ctrl -shift'

However, when I tried to bind to the square brackets:

xsetwacom --set "Wacom Intuos Pro S Pen pad" Button 11 'key ]'
xsetwacom --set "Wacom Intuos Pro S Pen pad" Button 9 'key ['

it did not work. Pressing these keys just types in 9 and 8.

My gut feeling is that it's some kind of problem to do with keyboard layouts (my layout vs whatever layout the developers of xsetwacom use) but I'm not sure where to go from there.

Edit: running xmodmap -pk|grep -i bracket as per the comment gives:

 17     0x0038 (8)  0x002a (asterisk)   0x0038 (8)  0x002f (slash)  0x005b (bracketleft)    0x0ac9 (trademark)  0x1000300 (U0300)   0x1000301 (U0301)   
 18     0x0039 (9)  0x0028 (parenleft)  0x0039 (9)  0x0aaa (endash) 0x005d (bracketright)   0x00b1 (plusminus)  
 34     0x005b (bracketleft)    0x007b (braceleft)  0x06c3 (Cyrillic_tse)   0x06e3 (Cyrillic_TSE)   0xfe57 (dead_diaeresis) 0xfe58 (dead_abovering) 
 35     0x005d (bracketright)   0x007d (braceright) 0x003b (semicolon)  0x00a7 (section)    0xfe53 (dead_tilde) 0xfe54 (dead_macron)    
 49     0x0060 (grave)  0x00ac (notsign)    0x0028 (parenleft)  0x0029 (parenright) 0x007c (bar)    0x007c (bar)    0x005b (bracketleft)    0x005d (bracketright)
  • does ] appear on the same key as 9 but shifted? Does xmodmap -pk|grep -i bracket show bracketleft and bracketright in the first column? – meuh Aug 8 '15 at 16:22
  • @meuh Updated my post with the output from that command. – Andrey Aug 8 '15 at 16:39
  • Possibly relevant: I've got a Bulgarian keyboard layout enabled, and that accounts for the third and fourth entries in that output. Not sure why bracketleft and bracketright appear afterwards. – Andrey Aug 8 '15 at 16:57

So there is ambiguity in the mapping tables for bracketleft and bracketright. Perhaps if you remove the ones you dont want to match it will be ok. Eg for keycode 17 do:

xmodmap -e 'keycode  17 = 8 asterisk 8 slash trademark trademark U0300 U0301'

where I just replaced column 5 with a duplicate of column 6. By the way, xmodmap -pke will print the mapping in a format you can reuse for -e.

  • Sweet! That does the trick. – Andrey Aug 8 '15 at 17:18
  • Is it something I need to run on startup or do the settings persist? – Andrey Aug 8 '15 at 17:19
  • @Andrey you need to run it every time. But there must be a file somewhere with this setup in it which you could copy, edit, and then provide to the server. – meuh Aug 8 '15 at 17:27
  • Yeah, no problem - I'll be putting all my wacom specific stuff in a shell script that runs on startup. Thanks for your help! – Andrey Aug 9 '15 at 9:13

You have to do something like:

xsetwacom --set "Wacom Intuos Pro S Pen pad" Button 11 'key +altgr 9 -altgr'

xsetwacom --set "Wacom Intuos Pro S Pen pad" Button 9 'key +altgr 8 -altgr'

I am not sure whether altgr is exactly right, you'll need to figure out the abbreviation for the Alt Gr key.

The man pages say:

The driver can only simulate physical key events but not keysyms and xetwacom translates the mapping sequence into such events. Thus, symbols on the same physical key will generate the same event. For example, '1' and '!' are on the same key on a US keyboard and thus have the same keycode). For access to keys on a higher shift level, the sequence should be entered as it would be typed on a physical keyboard. For example, a exclamation mark is entered by the sequence of "key +shift 1 -shift".

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.