Mapping HUION H610 Drawing Tablet Buttons

A quick one. I had previously only used my HUION H610 tablet with Windows so I was surprised to find how easy it was to set up and go in Linux.

Plugging it in via USB and the stylus worked out of the box for my Lubuntu 20.04 LTS (kernel 5.4.0) but none of the tablet buttons were working.

Here are the steps I took to fix this:

First check if it’s recognised as a tablet driver:

[email protected]:~$ xsetwacom --list

If there is no output then it needs to be loaded.

List USB devices to get the tablet’s USB ID – mine had a blank name/description (256c:006e)

[email protected]:~$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 006: ID 256c:006e
Bus 001 Device 005: ID 0461:4ec0 Primax Electronics, Ltd
Bus 001 Device 004: ID 046d:c534 Logitech, Inc. Unifying Receiver
Bus 001 Device 003: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 001 Device 002: ID 0a46:1269 Davicom Semiconductor, Inc. DM9621 USB To Fast Ether
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Now to configure the tablet input with wacom drivers I did the following:

[email protected]:~$ sudo nano /etc/X11/xorg.conf.d/52-tablet.conf

# Inside I pasted the following:
Section "InputClass"                                                                                                                                                                                                                         
  Identifier "Huion on wacom"                                                                                                                                                                                                                
  MatchUSBID "256c:006e"                                                                                                                                                                                                                     
  MatchDevicePath "/dev/input/event*"                                                                                                                                                                                                        
  Driver "wacom"                                                                                                                                                                                                                             
EndSection

Reboot and check that it is now recognised in xsetwacom:

[email protected]:~$ xsetwacom --list                                                                                                                                                                                                              
HUION PenTablet Pen stylus              id: 12  type: STYLUS                                                                                                                                                                                 
HUION PenTablet Pad pad                 id: 13  type: PAD 

Finally it’s time to map the buttons. For convenience I followed recommendations to create a bash script that would run on session start to persist the mappings:

#!/bin/sh                                                                                                                                                                                                                                    
xsetwacom --set 'HUION PenTablet Pad pad' Button 1 "key +ctrl +z -z -ctrl"                                                                                                                                                                   
xsetwacom --set 'HUION PenTablet Pad pad' Button 2 "key e"                                                                                                                                                                                   
xsetwacom --set 'HUION PenTablet Pad pad' Button 3 "key b"                                                                                                                                                                                   
xsetwacom --set 'HUION PenTablet Pad pad' Button 8 "key +"                                                                                                                                                                                   
xsetwacom --set 'HUION PenTablet Pad pad' Button 9 "key -"                                                                                                                                                                                   
xsetwacom --set 'HUION PenTablet Pad pad' Button 10 "key ]"                                                                                                                                                                                  
xsetwacom --set 'HUION PenTablet Pad pad' Button 11 "key ["                                                                                                                                                                                  
xsetwacom --set 'HUION PenTablet Pad pad' Button 12 "key p" 

And it is as simple as that. The tablet and stylus are fully functional and can be further customised to suit individuals needs.

References