forum

[Linux] Guide to set huion (or other non-wacom) tablet area!

posted
Total Posts
12
Topic Starter
HitCoder

EDIT: There is now a new project known as OpenTabletDriver. The github repository is here: https://github.com/OpenTabletDriver/OpenTabletDriver



Hello, I've been browsing and haven't found anything on setting a tablet area for a Huion graphics tablet.
The example here is using a Huion H610, this should have identical procedures for H610 pro as they are technically the same tablet but with different pens, and this guide SHOULD apply to all Huion tablets, as the DIGImend page states it is compatible with most, if not all, huion tablets.
First of all, you will want to download your appropriate driver from here: https://digimend.github.io/drivers/
Scroll to digimend-kernel-drivers and open the link to the newest version (current is v6)
When you scroll down on the next page, you'll find a deb download, and three source code links. If you are not running an Ubuntu or Debian based build, download the source code from any of the three links, which one doesn't matter.

Installing from source code
extract the zip or tar.gz files into any directory, I'd suggest Documents/ and then open terminal and "cd" to the directory, for example
cd ~/Documents/digimend-kernel-drivers-6/
now type in the console
make
and then
sudo make install

Now reboot.

Once your system is logged back in, open a terminal and the following command will be used to set the active area:
xinput set-prop "HUION PenTablet Pen" --type=float "Coordinate Transformation Matrix" W 0 X 0 H Y 0 0 S
Leave all 0s the same, or mess with them if you want different rotations, but before you jump in and copy + edit this command let me run through what each part does:
"HUION PenTablet Pen" - type xinput into terminal and look for each device relevant to your tablet, replace this if it doesn't work and go through each different option shown in xinput.
W - Division of the width of the tablet. 2 = half, 1 = full area. 1.5 = 3/4 of the area
X - the invert X value. 1 = left side, -1 = right hand side. -0.5 = half way
H - Division of the height of the tablet. 2 = half, 1 = full area. 1.5 = 3/4 of the area
Y - Inverse Y position of area. 1 = top, -1 = bottom, -0.5 = half way.
S - Scale multiplier. 0.5 means the area will be shrunk to half of its size on both axis. 2 will essentially render the area useless, as it will only use a half of your desktop area.

For example, the command I use is
xinput set-prop "HUION PenTablet Pen" --type=float "Coordinate Transformation Matrix" 1.6 0 -0.5 0 1.4 0 0 0 1
And the default setting is
xinput set-prop "HUION PenTablet Pen" --type=float "Coordinate Transformation Matrix" 1 0 0 0 1 0 0 0 1

To write an executable shell script that will execute this command do the following:
Type into terminal;
nano ~/Documents/OsuTabletArea.sh
Type this into the script;
#!/bin/bash
xinput set-prop "HUION PenTablet Pen" --type=float "Coordinate Transformation Matrix" W 0 X 0 H Y 0 0 S
If you want to copy/paste it, copy that and to paste it into the nano script use ctrl+shift+v.

Have fun, post any questions and I'll respond ASAP!
Canadian
Thank you.
Topic Starter
HitCoder

SinnPacked wrote:

Thank you.
You're welcome :D
minte
I'm having the error:

~$ xinput set-prop "HUION PenTablet Pen" --type=float "Coordinate Transformation Matrix" 1.6 0 -0.5 0 1.4 0 0 0 1
unable to find device HUION PenTablet Pen
~$
Anything I'm doing wrong here. I am using a huion 420 (not h420).
Thanks,
JSE
I have never changed tablet area on linux before but the error returned is pretty self explanatory. The device you specified doesn't exist.
Run xinput to list devices, it'll probably be worded a little differently.

Also huion driver has existed in the linux kernel for a while now so the step on installing it shouldn't be needed FWIW.

Good luck, as I just went back to windows since I hate wine :P
minte
Thanks, new error when trying:
xinput set-prop "HUION 420 Pen" --type=float "Coordinate Transformation Matrix" 1.6 0 -0.5 0 1.4 0 0 0 1

Error:
X Error of failed request:  BadMatch (invalid parameter attributes)
Major opcode of failed request: 131 (XInputExtension)
Minor opcode of failed request: 57 ()
Serial number of failed request: 19
Current serial number in output stream: 20
Zedespook
I have the same problem as minte.
qwr
DIGImend now provides a .deb that can be installed with dpkg.

The values are part of a 3x3 matrix that is multiplied by a column vector representing input x and y.

To paraphrase ArchWiki:

[ c0 0  c1 ] [tx]   [sx]
[ 0 c2 c3 ] [ty] = [sy]
[ 0 0 1 ] [ 1] [ s]

c0 = touch_area_width / total_width
c2 = touch_area_height / total_height
c1 = touch_area_x_offset / total_width
c3 = touch_area_y_offset / total_height

tx, ty = tablet x,y
sx, sy = screen x,y
s = scale?

Represented in row-by-row array:
c0 0 c1 0 c2 c3 0 0 1

In my experience, though, c1 and c3 scale with c0 and c2. So if c0 and c2 are doubled, c1 and c3 need to be as well. Not sure why.
Usami Mizuki
Thanks!
StratusFearMe21
for those of you on the VEIKK S640 you dont need drivers and instead of inputing "Huion 420 Pen" put in the id of the tablet, you can find that by running "xinput list" in a terminal
Topic Starter
HitCoder
I'm only posting here for anyone who comes here in future.

This solution is completely unnecessary now, as OpenTabletDriver exists.
Please see https://github.com/OpenTabletDriver/OpenTabletDriver for more info!
RaZnAr0k
Thanks for the xinput tip! Finally got the right mix for my Huion H420 Tablet! (OpenTabletDriver doesn't work out-of-the-box with Huion H420, according to their website).
Please sign in to reply.

New reply