Graphic Tablets on Linux

Oh ok
I often use documentation from https://wiki.archlinux.org because it’s often well detailled and more complete than documentation I can found on Debian sites :sweat_smile:

That’s strange… on my side to be able to configure my 13.3 the only thing I was able to found was about the 15.6 (there’s just few modification to do for a 13.3 as USB HID is not the same)

No
Using the wacom driver for your XPPen tablet doesn’t allows the configuration through KDE interface, only Wacom tablet are supported by the interface.

To be able to use my XP Pen Artist 13.3 on Debian, I had to:

  • create specific udev rules to let the system recognize buttons
  • create specific xorg.conf configuration
  • create a shell script executed at session startup to map buttons

Ok :slight_smile:
So I can provide you what I’ve made on my side

Technical details

:warning: :warning: NOTE: THIS IS HIGHLY TECHNICAL AND I RECOMMEND FOR WHOM WANT TO FOLLOW IT TO HAVE A MINIMUM LINUX ADMIN KNOWLEDGE AND TO UNDERSTAND THE CONFIGURATION/COMMAND – PLAYING WITH THIS CAN BROKE YOUR LINUX OR PUT IT IN AN UNSTABLE STATE AND IF ANY PROBLEM OCCURS YOU MUST BE ABLE TO RESTORE CONFIGURATION BY YOURSELF :warning: :warning:

Before starting, check your tablet:

$ lsusb
Would provide something like this in list:
Bus 009 Device 002: ID 28bd:000b
the tablet is not named, you have to know the HID (for a 15.6 i think that HID is 28bd:000c so you have to change 000b by 000c everywhere in configuration)

The udev configuration

File /etc/udev/hwdb.d/10-xp-pen-keyboard.hwdb

evdev:input:b0003v28BDp000B*
 KEYBOARD_KEY_d0045=332

File /etc/udev/rules.d/67-xorg-xppen.rules

KERNEL!="event[0-9]*", GOTO="xppen_end"

ENV{ID_VENDOR_ID}=="28bd", ENV{ID_MODEL_ID}=="000b", ENV{x11_driver}="wacom", KERNEL=="event8", SYMLINK+="input/xppen-pad", NAME="XP-PEN ARTIST 13.3 pad"
ENV{ID_VENDOR_ID}=="28bd", ENV{ID_MODEL_ID}=="000b", ENV{x11_driver}="wacom", KERNEL=="event7", SYMLINK+="input/xppen-stylus"

LABEL="xppen_end"

To know the event number, do the following
$ sudo evtest
You should get in list something like this:

/dev/input/eventX:	XP-PEN ARTIST 13.3 Mouse
/dev/input/eventY:	XP-PEN ARTIST 13.3
/dev/input/eventZ:	XP-PEN ARTIST 13.3

Note: the event number may change…

And then
$ sudo udevadm info -a /dev/input/eventX
Would provide you all information needed to eventually update your udev configuration files for XP Pen Artist 15.6

The XOrg configuration

File /etc/X11/xorg.conf.d/12-xppen-tablet.conf

Section "InputClass"
    Identifier "Tablet0"
    MatchUSBID "28bd:000b"
    MatchDevicePath "/dev/input/event*"
    MatchIsTablet "on"
    Driver "wacom"

    # note: to define these parameters properly, you can use xinput_calibrator tool
    #       that provide an interface to calibrate the pen and then provide XOrg configuration
    #       to apply
    Option  "MinX"  "168"
    Option  "MaxX"  "29238"
    Option  "MinY"  "-36"
    Option  "MaxY"  "16529"
    Option  "SwapXY"        "0" # unless it was already set to 1
    Option  "InvertX"       "0"  # unless it was already set
    Option  "InvertY"       "0"  # unless it was already set
EndSection

Section "InputDevice"
    Identifier "XP-PEN ARTIST 13.3 pad"
    Driver "wacom"
    Option "Device" "/dev/input/xppen-pad"
    Option "Type" "pad"
EndSection

File /etc/X11/xorg.conf.d/32-xppen-monitor.conf

Section "Monitor"
    # HorizSync source: unknown, VertRefresh source: unknown
    Identifier     "Monitor1"    
    VendorName     "XPPen"
    ModelName      "UGD Artist 133"
    HorizSync       31.0 - 70.0
    VertRefresh     59.0 - 61.0
    Option         "DPMS"
EndSection

File /etc/X11/xorg.conf.d/42-xppen-graphic.conf

Section "Device"
    Identifier     "Graphic1"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GT 630"
    BusID          "PCI:3:0:0"
    
    MatchSeat       "seat-1"    # Needed when only configuring part of Xorg for non-seat0.
EndSection

Note: I’m in a multi seat configuration so, comment/remove the MatchSeat if you’re not in multi-seat config (or replace it by seat0 that should be the default seat I think)

File /etc/X11/xorg.conf.d/62-xppen-layout.conf

    Identifier     "seat-1"
    Screen         "Screen1" 0 0

    InputDevice    "Keyboard1" "CoreKeyboard"
    InputDevice    "Mouse1" "CorePointer"

    #InputDevice    "Tablet0" "SendCoreEvents"
    InputDevice     "XP-PEN ARTIST 13.3 pad"

    Option         "Seat"    "seat-1"
    Option         "SingleCard" "on"
    Option         "AllowEmptyInput" "true"
    Option         "AllowEmptyInitialConfiguration" "true"

Note: I’m in a multi seat configuration so, comment/remove the Seat if you’re not in multi-seat config (or replace it by seat0 that should be the default seat I think)

Apply changes

When udev and xorg conf are modified, you can apply change without having to reboot with:

$ sudo udevadm control --reload
$ sudo udevadm trigger
$ sudo systemctl restart display-manager

Note: udev symlink must be defined before XOrg configuration is updated as the xorg configuration refers to symlink /dev/input/xppen-pad defined here

The shell script executed at startup session
#!/bin/sh

xsetwacom set "XP-PEN ARTIST 13.3 pad" button 1 key tab
xsetwacom set "XP-PEN ARTIST 13.3 pad" button 2 key f10
xsetwacom set "XP-PEN ARTIST 13.3 pad" button 3 key alt
xsetwacom set "XP-PEN ARTIST 13.3 pad" button 8 key f12
xsetwacom set "XP-PEN ARTIST 13.3 pad" button 9 key shift
xsetwacom set "XP-PEN ARTIST 13.3 pad" button 10 key ctrl

xsetwacom set "XP-PEN ARTIST 13.3 stylus" area 233 -38 29395 16486 
xsetwacom set "XP-PEN ARTIST 13.3 stylus" button 1 1
xsetwacom set "XP-PEN ARTIST 13.3 stylus" button 2 2 
xsetwacom set "XP-PEN ARTIST 13.3 stylus" button 3 3


echo "Tablet:              Pen:                                         "
echo "                                                                  "
echo "+---+                 _                                           "
echo "| 1 | (tab)          | |                                          "
echo "+---+                | |                                          "
echo "| 2 | (f10)          | |                                          "
echo "+---+                | |                                          "
echo "| 3 | (alt)          | |                                          "
echo "+---+                | |                                          "
echo "| 8 | (f12)          |o| <-- [right]  stylys.3 (button 3 = right)    "
echo "+---+                | |                                          "
echo "| 9 | (shift)        |o| <-- [middle] stylus.2 (button 2 = middle)"
echo "+---+                |_|                                          "
echo "| 10| (ctrl)         \ /                                          "
echo "+---+                 v  <-- [left]   stylus.1 (button 1 = left)  "

You have to install the xsetwacom utility for this.
I don’t remember how I was able to determinate which button number match with which physical button (maybe evtest…)

I think I provided practically everything I know about the subject…

There’s something missing in my documentation.
I think I’ve used digimend, but I may have installed xf86-input-wacom instead.
Don’t remember this part, I only took notes on all complex configuration files and action needed to have my tablet perfectly working…
I have to check packages installed on my computer and update my documentation :sweat_smile:

Grum999