xsetwacom - unable to bind a button to square brackets

1

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)

Andrey

Posted 2015-08-08T14:38:50.240

Reputation: 167

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 – 2015-08-08T16:22:09.470

@meuh Updated my post with the output from that command. – Andrey – 2015-08-08T16:39:31.130

1Possibly 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 – 2015-08-08T16:57:34.923

Answers

1

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.

meuh

Posted 2015-08-08T14:38:50.240

Reputation: 4 273

Sweet! That does the trick. – Andrey – 2015-08-08T17:18:21.830

Is it something I need to run on startup or do the settings persist? – Andrey – 2015-08-08T17:19:23.450

@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 – 2015-08-08T17:27:53.583

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 – 2015-08-09T09:13:32.453

1

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".

Josef

Posted 2015-08-08T14:38:50.240

Reputation: 11