Huion H610 Pro - button configuration #26

Closed
sunaku opened this Issue Feb 2, 2016 · 10 comments

Comments

Projects
None yet
7 participants

sunaku commented Feb 2, 2016

Hello,

I'm using a Huion H610 Pro graphics tablet with Linux kernel 4.3.4_1 which seems to already include the wonderful DIGImend drivers because I didn't have to compile and install the source code in this digimend-kernel-drivers repository for pressure sensitivity to work properly: instead, I just plugged in my tablet's USB cable and everything Just Worked! 🎅

Now, I want to configure the buttons on the left-hand side (outside the drawing surface) of my tablet. 🎹

I tried following the instructions in #22 (comment) but xsetwacom --list still doesn't see my tablet. 😞

The promising thing is that some portions of the tablet are recognized as "Keyboard" devices, so I'm thinking of creating a custom XKB keyboard model that maps my tablet's scancodes to key presses. 💡

Is this the proper way to do things?

Thanks for your consideration.

/var/log/Xorg.0.log

Here is what I see when I plug in my tablet's USB cable:

[  9694.071] (II) config/udev: Adding input device HUION PenTablet Pen (/dev/input/mouse1)
[  9694.071] (II) No input driver specified, ignoring this device.
[  9694.071] (II) This device may have been added with another device file.
[  9694.072] (II) config/udev: Adding input device HUION PenTablet Mouse (/dev/input/mouse2)
[  9694.072] (II) No input driver specified, ignoring this device.
[  9694.072] (II) This device may have been added with another device file.
[  9694.084] (II) config/udev: Adding input device HUION PenTablet Keyboard (/dev/input/event18)
[  9694.084] (**) HUION PenTablet Keyboard: Applying InputClass "evdev keyboard catchall"
[  9694.084] (II) Using input driver 'evdev' for 'HUION PenTablet Keyboard'
[  9694.084] (**) HUION PenTablet Keyboard: always reports core events
[  9694.084] (**) evdev: HUION PenTablet Keyboard: Device: "/dev/input/event18"
[  9694.084] (--) evdev: HUION PenTablet Keyboard: Vendor 0x256c Product 0x6e
[  9694.084] (--) evdev: HUION PenTablet Keyboard: Found keys
[  9694.084] (II) evdev: HUION PenTablet Keyboard: Configuring as keyboard
[  9694.084] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:14.0/usb2/2-5/2-5:1.2/0003:256C:006E.0038/input/input117/event18"
[  9694.084] (II) XINPUT: Adding extended input device "HUION PenTablet Keyboard" (type: KEYBOARD, id 14)
[  9694.084] (**) Option "xkb_rules" "evdev"
[  9694.087] (II) config/udev: Adding input device HUION PenTablet Consumer Control (/dev/input/event19)
[  9694.087] (**) HUION PenTablet Consumer Control: Applying InputClass "evdev keyboard catchall"
[  9694.087] (II) Using input driver 'evdev' for 'HUION PenTablet Consumer Control'
[  9694.087] (**) HUION PenTablet Consumer Control: always reports core events
[  9694.087] (**) evdev: HUION PenTablet Consumer Control: Device: "/dev/input/event19"
[  9694.087] (--) evdev: HUION PenTablet Consumer Control: Vendor 0x256c Product 0x6e
[  9694.087] (--) evdev: HUION PenTablet Consumer Control: Found 1 mouse buttons
[  9694.087] (--) evdev: HUION PenTablet Consumer Control: Found scroll wheel(s)
[  9694.088] (--) evdev: HUION PenTablet Consumer Control: Found relative axes
[  9694.088] (II) evdev: HUION PenTablet Consumer Control: Forcing relative x/y axes to exist.
[  9694.088] (--) evdev: HUION PenTablet Consumer Control: Found absolute axes
[  9694.088] (II) evdev: HUION PenTablet Consumer Control: Forcing absolute x/y axes to exist.
[  9694.088] (--) evdev: HUION PenTablet Consumer Control: Found keys
[  9694.088] (II) evdev: HUION PenTablet Consumer Control: Configuring as mouse
[  9694.088] (II) evdev: HUION PenTablet Consumer Control: Configuring as keyboard
[  9694.088] (II) evdev: HUION PenTablet Consumer Control: Adding scrollwheel support
[  9694.088] (**) evdev: HUION PenTablet Consumer Control: YAxisMapping: buttons 4 and 5
[  9694.088] (**) evdev: HUION PenTablet Consumer Control: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[  9694.088] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:14.0/usb2/2-5/2-5:1.2/0003:256C:006E.0038/input/input118/event19"
[  9694.088] (II) XINPUT: Adding extended input device "HUION PenTablet Consumer Control" (type: KEYBOARD, id 15)
[  9694.088] (**) Option "xkb_rules" "evdev"
[  9694.088] (II) evdev: HUION PenTablet Consumer Control: initialized for relative axes.
[  9694.088] (WW) evdev: HUION PenTablet Consumer Control: ignoring absolute axes.
[  9694.088] (**) HUION PenTablet Consumer Control: (accel) keeping acceleration scheme 1
[  9694.088] (**) HUION PenTablet Consumer Control: (accel) acceleration profile 0
[  9694.088] (**) HUION PenTablet Consumer Control: (accel) acceleration factor: 2.000
[  9694.088] (**) HUION PenTablet Consumer Control: (accel) acceleration threshold: 4
[  9694.089] (II) config/udev: Adding input device HUION PenTablet System Control (/dev/input/event20)
[  9694.089] (**) HUION PenTablet System Control: Applying InputClass "evdev keyboard catchall"
[  9694.089] (II) Using input driver 'evdev' for 'HUION PenTablet System Control'
[  9694.089] (**) HUION PenTablet System Control: always reports core events
[  9694.089] (**) evdev: HUION PenTablet System Control: Device: "/dev/input/event20"
[  9694.089] (--) evdev: HUION PenTablet System Control: Vendor 0x256c Product 0x6e
[  9694.089] (--) evdev: HUION PenTablet System Control: Found keys
[  9694.089] (II) evdev: HUION PenTablet System Control: Configuring as keyboard
[  9694.089] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:14.0/usb2/2-5/2-5:1.2/0003:256C:006E.0038/input/input119/event20"
[  9694.089] (II) XINPUT: Adding extended input device "HUION PenTablet System Control" (type: KEYBOARD, id 16)
[  9694.089] (**) Option "xkb_rules" "evdev"
[  9694.181] (II) config/udev: Adding input device HUION PenTablet Pen (/dev/input/event16)
[  9694.181] (**) HUION PenTablet Pen: Applying InputClass "evdev tablet catchall"
[  9694.181] (II) Using input driver 'evdev' for 'HUION PenTablet Pen'
[  9694.181] (**) HUION PenTablet Pen: always reports core events
[  9694.181] (**) evdev: HUION PenTablet Pen: Device: "/dev/input/event16"
[  9694.232] (--) evdev: HUION PenTablet Pen: Vendor 0x256c Product 0x6e
[  9694.232] (--) evdev: HUION PenTablet Pen: Found absolute axes
[  9694.232] (--) evdev: HUION PenTablet Pen: Found x and y absolute axes
[  9694.232] (--) evdev: HUION PenTablet Pen: Found absolute tablet.
[  9694.232] (II) evdev: HUION PenTablet Pen: Configuring as tablet
[  9694.232] (**) evdev: HUION PenTablet Pen: YAxisMapping: buttons 4 and 5
[  9694.232] (**) evdev: HUION PenTablet Pen: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[  9694.232] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:14.0/usb2/2-5/2-5:1.0/0003:256C:006E.0036/input/input114/event16"
[  9694.232] (II) XINPUT: Adding extended input device "HUION PenTablet Pen" (type: TABLET, id 17)
[  9694.232] (II) evdev: HUION PenTablet Pen: initialized for absolute axes.
[  9694.232] (**) HUION PenTablet Pen: (accel) keeping acceleration scheme 1
[  9694.232] (**) HUION PenTablet Pen: (accel) acceleration profile 0
[  9694.232] (**) HUION PenTablet Pen: (accel) acceleration factor: 2.000
[  9694.232] (**) HUION PenTablet Pen: (accel) acceleration threshold: 4
[  9694.233] (II) config/udev: Adding input device HUION PenTablet Mouse (/dev/input/event17)
[  9694.233] (**) HUION PenTablet Mouse: Applying InputClass "evdev pointer catchall"
[  9694.233] (II) Using input driver 'evdev' for 'HUION PenTablet Mouse'
[  9694.233] (**) HUION PenTablet Mouse: always reports core events
[  9694.233] (**) evdev: HUION PenTablet Mouse: Device: "/dev/input/event17"
[  9694.284] (--) evdev: HUION PenTablet Mouse: Vendor 0x256c Product 0x6e
[  9694.284] (--) evdev: HUION PenTablet Mouse: Found 9 mouse buttons
[  9694.284] (--) evdev: HUION PenTablet Mouse: Found scroll wheel(s)
[  9694.284] (--) evdev: HUION PenTablet Mouse: Found relative axes
[  9694.284] (--) evdev: HUION PenTablet Mouse: Found x and y relative axes
[  9694.284] (II) evdev: HUION PenTablet Mouse: Configuring as mouse
[  9694.284] (II) evdev: HUION PenTablet Mouse: Adding scrollwheel support
[  9694.284] (**) evdev: HUION PenTablet Mouse: YAxisMapping: buttons 4 and 5
[  9694.284] (**) evdev: HUION PenTablet Mouse: EmulateWheelButton: 4, EmulateWheelInertia: 10, EmulateWheelTimeout: 200
[  9694.284] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:14.0/usb2/2-5/2-5:1.1/0003:256C:006E.0037/input/input115/event17"
[  9694.284] (II) XINPUT: Adding extended input device "HUION PenTablet Mouse" (type: MOUSE, id 18)
[  9694.284] (II) evdev: HUION PenTablet Mouse: initialized for relative axes.
[  9694.285] (**) HUION PenTablet Mouse: (accel) keeping acceleration scheme 1
[  9694.285] (**) HUION PenTablet Mouse: (accel) acceleration profile 0
[  9694.285] (**) HUION PenTablet Mouse: (accel) acceleration factor: 2.000
[  9694.285] (**) HUION PenTablet Mouse: (accel) acceleration threshold: 4

kriks57 commented Feb 18, 2016

Hi,
I thought I would add the same problem as you, but I could get a little bit further.
It seems evdev is the first module to load for tablet (catchall rule), so I had to comment the tablet part in
/usr/share/X11/xorg.conf.d/10-evdev.conf

Section "InputClass"
Identifier "evdev tablet catchall"
MatchIsTablet "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
EndSection

then adding /etc/X11/xorg.conf.d/52-tablet.conf containing

Section "InputClass"
Identifier "Huion on wacom"

MatchIsTablet "on"

MatchProduct "HUION"
MatchDevicePath "/dev/input/event*"
Driver "wacom"

EndSection

rebooting.

then xsetwacom --list works for me:

$ xsetwacom --list
HUION PenTablet Pad pad id: 12 type: PAD
HUION PenTablet Pen stylus id: 13 type: STYLUS

and the button are 1,2,3,8,9,10,11,12 like in the comment you mentioned.

I didn't search for the buttons on the top of the pad.

Maybe it can help you.

SOLUTION:

  • Installing digimend-kernel-drivers-6 from source followings the instructions.
  • Creating 52-tablet.conf because it didn't exist:
cd /etc/X11
sudo mkdir xorg.conf.d 
cd xorg.conf.d 
sudo gedit 52-tablet.conf 
  • Copy and paste the following in that file:
Section "InputClass"
Identifier "Huion on wacom"
# MatchIsTablet "on"
MatchProduct "HUION"
MatchDevicePath "/dev/input/event*"
Driver "wacom"
EndSection
  • Saving the file and restart.

  • Open the terminal and put the following: xsetwacom --list
    You should see something like this:

    HUION PenTablet Pad pad id: 13 type: PAD
    HUION PenTablet Pen stylus id: 14 type: STYLUS

The buttons are: 1,2,3,8,9,10,11,12.

  • Put this in the terminal, defining the desired keys for each button (Top-down on the tablet Huion H610 Pro) :
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 +ctrl"
xsetwacom --set "HUION PenTablet Pad pad" Button 8 "key +shift"
xsetwacom --set "HUION PenTablet Pad pad" Button 9 "key +ctrl +  -ctrl"
xsetwacom --set "HUION PenTablet Pad pad" Button 10 "key +ctrl -  -ctrl"
xsetwacom --set "HUION PenTablet Pad pad" Button 11 "key b"
xsetwacom --set "HUION PenTablet Pad pad" Button 12 "key space"

And ready, the buttons will function. :)

I'm trying this for an H610 Pro on Kubuntu 16.04 with 4.4 kernel (tried 4.5 as well via https://wiki.ubuntu.com/Kernel/MainlineBuilds) and it works pretty well without installing the digimend drivers but I'd like to customise the buttons, too, and so have tried the suggestions on here.

xsetwacom --list unfortunately shows the stylus only, and when I check the xorg log I see HUION PenTablet Consumer Control|Keyboard|Mouse|Pen|System Control devices only, no HUION PenTablet Pad pad. With evtest I can see that the HUION keyboard device does handle the button presses on the tablet.

Note I first tried without installing the digimend drivers, since everything but button reconfig seemed to work fine without them. When that didn't work I installed the .deb package and restarted but then xinput list doesn't even list a single HUION device and consequently the tablet doesn't work at all. Any ideas?

kriks57 commented Mar 6, 2016

@thomanski check syslog when you plug the tablet in, to be sure that evdev is not the driver loaded, you may have the same problem I had.

The buttons on the tablet unconfigures whenever the disconnect, Any idea? :/

@kriks57 You mean the xorg log, right? Can't find anything in syslog on this. Thanks to /var/log/Xorg.0.log I'm pretty sure the pad device just doesn't show up at all, it doesn't ever get mentioned.

In any case, I've now applied Clavos-Studios' steps to a Ubuntu 14.04 installation and that's all working fine.

The devices listed in Ubuntu 14.04 include "Pad" and "Pad pad", in Kubuntu 16.04 they were missing:

$fgrep HUION /var/log/Xorg.0.log | sed -e 's/.*HUION PenTablet \([^("'"'"':]*\).*/\1/;s/ $//g' | sort -u | tr "\n" "|"
Consumer Control|Consumer Control pad|Keyboard|Mouse|Pad|Pad pad|Pen|Pen stylus|System Control # <-- Ubuntu 14.04
Consumer Control|Consumer Control pad|Keyboard|Mouse|Pen|Pen stylus|System Control # <-- Kubuntu 16.04

@Clavos-Studios Looks like you have to manually re-apply or set up Wdaemon to have the changes automatically applied after a hotplug, see http://linuxwacom.sourceforge.net/wiki/index.php/Tablet_Configuration#Script_Survival_after_a_Hotplug

Owner

spbnick commented Jun 26, 2016

Hi everyone, the developer here. First of all, thanks to all for cooperating and finding a solution by yourselves!

I would really appreciate someone (everyone actually) to hang around and deal with user issues, letting me use more of my really scarce time to handle lower level issues.

Also, really great would be a HOWTO (or several) for the site. I'll gladly help whoever wants to do that to figure out the markup and the testing of the page. Just ping me.

@thomanski The difference between Ubuntu and Kubuntu is likely in the X.org input driver version.

@spbnick spbnick closed this Jun 26, 2016

momashi commented Nov 29, 2016

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
A COMPLETE GUIDE ON HOW TO CONFIGURE THE HUION H610 ON LINUX
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

(I just cut and pasted this from another post I made)

by Fadi R

CREDITS:

This guide is a meld of my own research and, to a greater degree, the answers of bebop(+David Foester) and pram on Ask Ubuntu (http://askubuntu.com/questions/500141/huion-h610-tablet) AS WELL AS Clavos-Studios post on the Digimend GitHub (#26). Thanks guys, I learned alot from your posts. And of course, Major Kudos to the DigiMend team and Nikolai Kondrashov (project founder). Their tireless work has opened up a wide spectrum of tablets to the Linux community. (http://digimend.github.io)

[0] TABLE OF CONTENTS:

[1] DRIVER INSTALLATION
[2] CONFIGURING AND MAPPING TABLET
[3] CONFIGURING APPS TO RUN WITH TABLET
[4] SUGGESTED SOFTWARE

[1] DRIVER INSTALLATION:

(1.1) Ensure that you have the following packages:
a) xf86-input-wacom
b) linux-headers (in Arch, Debian, Ubuntu or Mint) or kernel-headers (Red Hat)
(1.2) Download the latest Digimend drivers from Github (https://github.com/DIGImend/digimend-kernel-drivers). For some reason beyond me, I couldn't get the source code from the github.io Digimend site to compile (https://digimend.github.io/drivers/) but it may be different for you...
a) In terminal, input:
sudo rmmod hid-kye
sudo rmmod hid-uclogic
sudo rmmod hid-huion
b) extract digimend sourcecode (from github.com, it's: digimend-kernel-drivers-master.zip). In terminal browse to extracted dir and input:
make
sudo make install
(1.3) Setting up an 52-tablet.conf entry for the H610

a) make the 52-tablet.conf file if it doesn't exist:
sudo mkdir /etc/X11/xorg.conf.d 
cd /etc/X11/xorg.conf.d 
sudo gedit 52-tablet.conf 
	
b) paste this entry for the H610 in 52-tablet.conf:

Section "InputClass"
Identifier "Huion on wacom"
# MatchIsTablet "on"
MatchProduct "HUION"
MatchDevicePath "/dev/input/event*"
Driver "wacom"
EndSection 

c) save file and restart

d) upon restarting, when you open Terminal and input:
xsetwacom --list

(you should see:)	
HUION PenTablet Pad pad id: 11 type: PAD
HUION PenTablet Pen stylus id: 12 type: STYLUS
(the id will vary from machine to machine)

[2] CONFIGURING AND MAPPING TABLET:

(2.1) Defining Pad Left-Hand Buttons:
a) As we saw previously, the pad is defined "HUION PenTablet Pad pad" and it's button are: 1,2,3,8,9,10,11,12. These buttons will be undefined every time you log in. To define them, you can input the following command synthax in Terminal

xsetwacom --set 'DEVICE NAME' Button NUMBER "key KEYSTROKES"

b) You can automate it by making script file that autoruns every time you open a session. For example, my script is called Huion.Default.sh and I like bebop from AskUbuntu's button scheme:

#!/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"

c) Don't forget to give the script execution permission:
chmod +x Huion.Default.sh

d) You can make different scripts and button schemes for the different Apps you use with the tablet. When making lauchers, you can make those scripts lauch before you launch the apps themselves. You do this by editing the Command in the laucher or desktop file. For example: Command: ~/./GIMP-tablet-scheme.sh && /usr/bin/gimp 	

(2.2) More on xsetwacom:
Before we continue in configuring the tablet, here are a few usefull commands that you can do with xsetwacom.

(a) Checking button values: xsetwacom --get 'DEVICE NAME' Button BUTTON-NUMBER
eg. 	xsetwacom --get 'HUION PenTablet Pad pad' Button 1
eg.	xsetwacom --get 'HUION PenTablet Pen stylus' Button 1
(this very useful in figuring out the button scheme of the Pad and Stylus)
(b) xsetwacom --list parameters: this command will list what parameters xsetwacom can get and set. Example of the listed parameters are: Button, PressureCurve and Threshold. Be aware that since xf86-input-wacom is meant for Wacom tablets, there may be some parameters that won't apply to your H610.

(2.3) Defining Stylus Buttons:
The stylus is defined as "HUION PenTablet Pen stylus" and it's button are: 1,2,3 (the button order is: stylus head, toggle down, toggle up). Button are defined respectively "button +1 " "button +2" "button +3" (these are the xinput values for left click, middle click and right click). I wouldn't recommend modifying button 1 but if you want to modify the other 2 buttons, you can do it in the same manner as I showed you in section (2.1) and add the line to Huion.Default.sh

eg. if you want an eraser on your Stylus, you can sacrifice the middle-click on button 2 by inputing:
xsetwacom --set 'HUION PenTablet Pen stylus' Button 2 "key e"
(if you want to revert back to default:)
xsetwacom --set 'HUION PenTablet Pen stylus' Button 2 "button +2"

(2.4) Defining Pressure Curves:
To define the pressure curve, input:

xsetwacom --set 'HUION PenTablet Pen stylus' PressureCurve "PUT-YOUR-CURVE-HERE"

eg.

xsetwacom --set 'HUION PenTablet Pen stylus' PressureCurve "5 10 90 95"

This gave no errors but I haven't yet established if it actually affect pressure curves of the stylus. I'll update when I know.

Alot of application such as Krita and GIMP will have their own pressure curve settings. Sor far I've tested the pressure curves on GIMP and it seems to work well. More on that in Section 3.

(2.5) Left Hand Support
--- work in progress

[3] CONFIGURING APPS TO RUN WITH TABLET:

DigiMend's Support section has some really awesome guides on how to setup with your tablet with the following applications: Alchemy, Blender, GIMP, Inkscape, Krita, MyPaint, Synfig Studio and apps running out of Wine.

Just go to http://digimend.github.io/support/ and skip down to the "Application setup" section.

[4] SUGGESTED SOFTWARE:

-- Work in progress --

I use kde (5.9.5) neon 16.04 - I just updated to kernel 4.11 I noted that /usr/share/libwacom contains huion-h610-pro.tablet I wonder to what extent the h610 works since this kernel update and if the digimend driver is still needed my h610 has been shipped but not yet received.

Owner

spbnick commented May 8, 2017

The Wacom driver developers added support for some Huion tablets a while ago and you can try configuring the Wacom driver with your tablet. Even the graphical configuration utility might work, at least there was an effort to make it work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment