i'm trying to map my drawing tablet buttons and the command to do that for my particular scenario is:
xsetwacom --set 'Tablet Monitor Pad pad' Button 1 "key a"
xsetwacom --set 'Tablet Monitor Pad pad' Button 2 "key b"
The output would be:
- pressing button 1 > types the letter A,
- button 2 > types the letter B, etc.
And this works great, no problems. But when i try to set "key [" or "key ]" the output i get is a key press of the number 8 or 9 respectively.
I tried the command XEV to find the keycode:
And it turns out "bracketright"
is a thing, but setting this does exactly the same thing as ]
(outputs the number 9 instead of ])
i even tried the keycode (keysym?) of 0x5d
same result. (outputs 9
)
I'm not sure what to try next.. anyone have any ideas?
I'm using Ubuntu 18.04 with the DIGImend drivers (Which i have installed and are working) (my tablet is a Huion H640P if it helps..)
OH, i just thought of something that may help, my keyboard layout is English (UK). Dunno if that might mess with anything? I feel like the XEV
would have caught that regardless, but i feel like it's worth mentioning.
Edit: Turns out it does have something to do with the keyboard language, I set my keyboard to US and the output of [ and ] work perfectly.
I checked XEV for the keycode and it's the same as before.
Is this a bug? and should i report it? if so, then where?
And is there a way to check the actual binding/keycode for [
and ]
on the British keyboard layout?
Alright! answering my own question, I found the solution!
I found a similar question to mine over at superuser. One of the answers suggested using Alt-Gr and 8 or 9 (Which, just so happens to be another funky way of typing [ or ] )
ALT_R was not accepted by xsetwacom, it would output:
Warning: unable to map 'Alt_R' to a keycode.
So i used
XEV
to figure out what the mapping was for Alt-Gr on my keyboard, it told me it was:keycode 108 (keysym 0xfe03, ISO_Level3_Shift)
so i set my buttons with the lines:
And wouldn't you know it, it worked. pressing my tablet buttons types [ or ]. I tested it in Krita and it does exactly as expected and changes the brush size.
I spent two days looking for this answer. I hope someone who has the same problem stumbles across this answer and it helps them too.