Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup Huion Q11 v2 tablet on Linux #510

Open
MimosaBoo opened this issue Jan 25, 2021 · 13 comments
Open

Setup Huion Q11 v2 tablet on Linux #510

MimosaBoo opened this issue Jan 25, 2021 · 13 comments

Comments

@MimosaBoo
Copy link

MimosaBoo commented Jan 25, 2021

Hello everyone,
I share my success of the day, that of having succeeded in setting the keys of the Huion Q11 V2 graphics tablet on linux!
(With the help of David Revoy, and his post
https://www.davidrevoy.com/article331/setup-huion-giano-wh1409-tablet-on-linux-mint-18-1-ubuntu-16-04
and a programmer friend.

I use Linux Mint 20.1

Here are the steps to install and set up your Huion Q11 v2 tablet.

1/Install Digimend driver via DKMS:

sudo apt install dkms git-core

sudo git clone https://github.com/DIGImend/digimend-kernel-drivers.git /usr/src/digimend-6
sudo dkms build digimend/6
sudo dkms install digimend/6

Reboot your computer. The tablet should now start to work better, smoother and being listed as "HUION Huion Tablet stylus" when entering this command in a terminal:

xinput --list

The digimend driver should be listed among other modules after typing:

dkms status

You can us now use the tablet in wireless with dongle USB.

2/Add a custom X11 rules:

To configure the tablet, the buttons. We will add a X11 custom rule to make the Digimend driver use the Wacom driver command line tool to setup our . Call your text-editor in admin mode:

sudo xed /usr/share/X11/xorg.conf.d/50-huion.conf

Then paste this inside, save and close.

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

Section "InputClass"  
    Identifier "Huion buttons"  
    MatchProduct "HUION"  
    MatchIsKeyboard "on"  
    MatchDevicePath "/dev/input/event*"  
    Driver "evdev"  
EndSection  

Section "InputClass"  
    Identifier "Huion scroll"  
    MatchProduct "HUION"  
    MatchIsPointer "off"  
    MatchIsKeyboard "off"  
    MatchIsTouchpad "off"  
    MatchIsTablet "off"  
    MatchIsTouchscreen "off"  
    MatchDevicePath "/dev/input/event*"  
    Driver "evdev"  
EndSection

Reboot your computer. After that, the tablet should appear in the configuration tool xsetwacom:

xsetwacom --list

Congratulation! You're done with the driver part.

3/User preference, buttons, settings.

Now, let configure the tablet with xsetwacom.

We need to store this collections of commands in a bash script and call this bash script when the system open.

mkdir scripts  
xed ~/scripts/Huion_Q11v2.sh

... and inside paste and customize the script under.

Don't forget to change the screen size to your screen size (the tablet is not 100% same ratio than 1920x1080, it needs code to force good vertical and horizontal ratio so when you trace a circle on your tablet, a circle appear on the screen, and not an ellipse potato ). And comment or delete all the line you are not interested.

#! /bin/bash  
# Setup HUION Q11 v2, after bridged to wacom driver with Digimend Kernel module.  
# License: CC-0/Public-Domain license  
# author: deevad  

# Tablet definition  
tabletstylus="HUION Huion Tablet stylus"  
tabletpad="HUION Huion Tablet Pad pad"  

# Reset  
xsetwacom --set "$tabletstylus" ResetArea  
xsetwacom --set "$tabletstylus" RawSample 4  

# Mapping  
# get maximum size geometry with:  
# =============
# xsetwacom --get "$tabletstylus" Area  
# doesn't work, I don't know why, but it works: :
# xsetwacom --get "HUION Huion Tablet stylus" Area 
# =============
# 0 0 55880 34925  
tabletX=55880  
tabletY=34925  
# screen size:  
screenX=1920  
screenY=1080  
# map to good screen (dual nvidia)  
# xsetwacom --set "$tabletstylus" MapToOutput "HEAD-0"  
# setup ratio :  
newtabletY=$(( $screenY * $tabletX / $screenX ))  
xsetwacom --set "$tabletstylus" Area 0 0 "$tabletX" "$newtabletY"  


# Buttons  
# =======  
xsetwacom --set "$tabletstylus" Button 2 2   
xsetwacom --set "$tabletstylus" Button 3 3  
# ---------  
# | 12 |
# | -- |
# | 11 |
# | -- |
# | 10 |
# | -- |
# |  9 |
# |=======|  
# |  8 |
# | -- |
# |  3 |
# | -- |
# |  2 |
# | -- |
# |  1 |
# |=======| 


xsetwacom --set "$tabletpad" Button 12 "key +ctrl a" # Select all
xsetwacom --set "$tabletpad" Button 11 "key +ctrl shift a" # Deselect
xsetwacom --set "$tabletpad" Button 10 "key +ctrl r" # Selection tool
xsetwacom --set "$tabletpad" Button 9 "key t" # Transform tool
xsetwacom --set "$tabletpad" Button 8 "key b"  # Brush
xsetwacom --set "$tabletpad" Button 3 "key Shift_L" # Resize brush
xsetwacom --set "$tabletpad" Button 2 "key m" # Mirror 
xsetwacom --set "$tabletpad" Button 1 "key +ctrl z" # Undo 


# Xinput option  
# =============  
# for the list:  
# xinput --list  zz

# xinput list-props 'HUION Huion Tablet Pen Mouse' 
xinput list-props 'HUION Huion Tablet Touch Strip pad' "Evdev Middle Button Emulation" 0 
# xinput set-prop 'HUION Huion Tablet Pen' "Evdev Middle Button Emulation" 0  
# alternate way to map to a single screen  
# execute "xrander" in a terminal to get the screen name ( DVI-D-0 in this example )  
# xinput set-prop 'HUION' DVI-D-0

When your script is finished you can save it. Then give it execute permission: In the file-manager ; right-click on it again > Properties > Permissions > and in front of Execute check the box for 'Allow executing file as a program'. You can now double click and run the script. Test and adjust to your needs. Your key on tablet will be mapped for the active session. To keep the settings accross reboot, you'll have to auto execute the script at start-up. To do this, go to 'System Settings', then 'Start-up application'. A user interface will propose you to add your script as a start-up script. You can also create a Menu entries if you need to run multi-scripts (right click on the menu button > Configure > Menu (Tab) > Open the menu editor to create a custom menu entry).

tadaaa

@Miratu
Copy link

Miratu commented Jul 1, 2021

Hardware: Huion Inspiroy Q11K v2
lsusb: 256c:006e HUION Huion Tablet
Vendor: Huion
Product: Inspiroy Q11K v2
Status:
Specs: 279,4 x 174,6mm (11″×6.875″), 5080 LPI, 266 RPS , 8192 PL, tilt-sensitive, Frame controls 8 buttons, wireless.

Distro: Ubuntu 20.04 LTS
Kernel: 5.7.7-050707-generic(x86_64)

I already had Digimend 10 installed for the previous tablet (Gaomon M10K Pro) that my son now uses, with windows.

Currently I use a Huion Inspiroy Q11K V2 and I have followed the steps indicated by @valent1draw from point 2 and as he says: tadaa !!!

Everything works perfectly, without jumps and with total smoothness, although I have not been able to test the inclination of the pen. At the end I attach all the tests. I wish they were useful.

The script has been as follows.

#! /bin/bash  
# Setup HUION Q11 v2, after bridged to wacom driver with Digimend Kernel module.  
# License: CC-0/Public-Domain license  
# author: deevad  

# Tablet definition  
tabletstylus="HUION Huion Tablet stylus"  
tabletpad="HUION Huion Tablet Pad pad"  

# Reset  
xsetwacom --set "$tabletstylus" ResetArea  
xsetwacom --set "$tabletstylus" RawSample 4  

# Mapping  
# get maximum size geometry with:  
# =============
# xsetwacom --get "$tabletstylus" Area  
# doesn't work, I don't know why, but it works: :
# xsetwacom --get "HUION Huion Tablet stylus" Area 
# =============
# 0 0 55880 34925  
tabletX=55880  
tabletY=34925  
# screen size:  
screenX=1920  
screenY=1080  
# map to good screen (dual nvidia)  
# xsetwacom --set "$tabletstylus" MapToOutput "HEAD-0"  
# setup ratio :  
newtabletY=$(( $screenY * $tabletX / $screenX ))  
xsetwacom --set "$tabletstylus" Area 0 0 "$tabletX" "$newtabletY"  

echo change orientation to use left hand
echo if you are right-handed, deactivate this line
xsetwacom --set "$tabletstylus" Rotate half

# Buttons  
# =======  
xsetwacom --set "$tabletstylus" Button 2 2   
xsetwacom --set "$tabletstylus" Button 3 3 
echo for right-handed use, reverse the order of the buttons  
# ---------  
# |  1 |
# | -- |
# |  2 |
# | -- |
# |  3 |
# | -- |
# |  8 |
# |=======|  
# |  9 |
# | -- |
# | 10 |
# | -- |
# | 11 |
# | -- |
# | 12 |
# |=======| 

echo for right-handed use, reverse the order of the buttons 
echo enter the commands with quotation marks to suit the user 
xsetwacom --set "$tabletpad" Button 1 "key control"
xsetwacom --set "$tabletpad" Button 2 "key shift"
xsetwacom --set "$tabletpad" Button 3 "key s"
xsetwacom --set "$tabletpad" Button 8 "key r"
xsetwacom --set "$tabletpad" Button 9 "key g"
xsetwacom --set "$tabletpad" Button 10 "key +ctrl +z -z -ctrl"
xsetwacom --set "$tabletpad" Button 11 "key +shift +d -d -shift"
xsetwacom --set "$tabletpad" Button 12 "key tab"

# Xinput option  
# =============  
# for the list:  
# xinput --list  zz

# xinput list-props 'HUION Huion Tablet Pen Mouse' 
xinput list-props 'HUION Huion Tablet Touch Strip pad' "Evdev Middle Button Emulation" 0 
# xinput set-prop 'HUION Huion Tablet Pen' "Evdev Middle Button Emulation" 0  
# alternate way to map to a single screen  
# execute "xrander" in a terminal to get the screen name ( DVI-D-0 in this example )  
# xinput set-prop 'HUION' DVI-D-0

I'm left-handed so it's set to hold the stylus with my left hand and the buttons on the right side.

Thanks "DIGImenders" for your help.
Apologies for my "google-english".

descriptors.txt
frame_buttons.txt
hid_report_descriptors.txt
pen_buttons.txt
pen_coords.txt
pen_pressure.txt
pen_tilt.txt
probe.txt

@MimosaBoo
Copy link
Author

MimosaBoo commented Jul 4, 2021

Hello @Miratu !

To put the tablet in left-handed mode, which is also my case, you can go into the software "tablet graphic", ("tablette graphique" on linux mint in french)
as with the previous code, all the drivers are well installed this software should detect your tablet and offer you different settings. (Hoping that the software "Tablet graphic" exists on your linux)

If not, to translate, you can use the site https://www.deepl.com

^^

@nexar
Copy link

nexar commented Feb 9, 2022

I like Miratu have already got digimend 10 installed. Here is my output from dkms status:

bcmwl, 6.30.223.271+bdcom, 4.15.0-163-generic, x86_64: installed
bcmwl, 6.30.223.271+bdcom, 4.15.0-166-generic, x86_64: installed
digimend, 10, 4.15.0-163-generic, x86_64: installed
digimend, 10, 4.15.0-166-generic, x86_64: installed

I then carried out Step 2 by MimosaBoo i.e. added the file 50-huion.conf with the text pasted inside and then rebooted.

However my xsetwacom --list command produces no output messages.

My Q11 v2 works using the usb cable but I want to configure it's buttons.

My question is :
Should I carry on to Step 3 or is there some additional work I need to do to get xsetwacom to list my tablet?

Thanks for any help.

@nexar
Copy link

nexar commented Feb 11, 2022

Since writing the above I did a reboot and now everything has sprung to life. I've also managed to set up the buttons, although reversed as I'm right handed.

Thanks very much @MimosaBoo and @Miratu

@MimosaBoo
Copy link
Author

@nexar Sorry I didn't see your message.
I'm glad everything is back to normal!

The shortcut keys have not been working for a few days. Did anyone have the problem?

@nexar
Copy link

nexar commented Feb 15, 2022

@MimosaBoo, the keys on my Q11 pad are working fine all the time. Have you upgraded your OS at all?

@MimosaBoo
Copy link
Author

MimosaBoo commented Feb 15, 2022

@nexar All the keys worked until a short time ago.
My os is up to date.

@nexar
Copy link

nexar commented Feb 16, 2022

@MimosaBoo Hmmm I do something slightly different. Rather than having the script assigning the keys running at boot up I run it as part of loading my graphics software. This is because my tablet is not permanently connected to the laptop but only when I want to use it.

Is it possible that your tablet is not activated before the shell script runs? If you run the shell script manually do the keys work after it has run?

@MimosaBoo
Copy link
Author

MimosaBoo commented Feb 18, 2022 via email

@nexar
Copy link

nexar commented Feb 18, 2022

Sorry in your initial post you said that you had it set up to run at boot time. I can't see how the key ids would change by themselves. Even if there was a firmware upgrade it is unlikely that key ids would be changed.

@MimosaBoo
Copy link
Author

$ tabletpad="HUION Huion Tablet Pad pad"
$ xsetwacom set "$tabletpad" Button 2 "key m"

When i test this code in the terminal, it does not result in an error.
But the keys still do nothing

@MimosaBoo
Copy link
Author

I found it!
It has a button on the side of the tablet to lock it.
I must have activated it by mistake... ( ಠ ʖ̯ ಠ)

@nexar
Copy link

nexar commented Mar 7, 2022

Hahaha!! So there is. I didn't know about it either. Thanks for sharing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants