FreeBSD + Huion pad + Okular = PDF comments

Boris Samorodov bsam at passap.ru
Thu Jun 4 22:02:14 UTC 2020


Hi All!

I've got a Huion H640P pad for PDF documents commenting and managed to 
use it with FreeBSD. The pad (usbconfig):
ugen0.6: <vendor 0x256c product 0x006d> at usbus0, cfg=0 md=HOST 
spd=FULL (12Mbps) pwr=ON (100mA)

1. Fix /usr/local/etc/rc.d/wacom so the pad is not used as a mouse (ums):
-----
% diff -u wacom.orig wacom
--- wacom.orig  2020-06-05 00:37:41.365545000 +0300
+++ wacom       2020-06-04 20:13:46.478145000 +0300
@@ -35,12 +35,16 @@
         # Prevent moused(8) from picking up bogus /dev/umsN
         usbconfig add_dev_quirk_vplh 0x056a 0 0 0xffff UQ_MATCH_VENDOR_ONLY
         usbconfig add_dev_quirk_vplh 0x056a 0 0 0xffff UQ_UMS_IGNORE
+       usbconfig add_dev_quirk_vplh 0x256c 0 0 0xffff UQ_MATCH_VENDOR_ONLY
+       usbconfig add_dev_quirk_vplh 0x256c 0 0 0xffff UQ_UMS_IGNORE
  }

  wacom_stop()
  {
         usbconfig remove_dev_quirk_vplh 0x056a 0 0 0xffff 
UQ_MATCH_VENDOR_ONLY
         usbconfig remove_dev_quirk_vplh 0x056a 0 0 0xffff UQ_UMS_IGNORE
+       usbconfig remove_dev_quirk_vplh 0x256c 0 0 0xffff 
UQ_MATCH_VENDOR_ONLY
+       usbconfig remove_dev_quirk_vplh 0x256c 0 0 0xffff UQ_UMS_IGNORE
  }

  run_rc_command "$1"
-----

2. Add the pad to /usr/local/etc/devd/webcamd.conf^
-----
% diff -u webcamd.conf.orig webcamd.conf
--- webcamd.conf.orig   2020-06-05 00:41:05.265602000 +0300
+++ webcamd.conf        2020-06-04 23:24:26.235005000 +0300
@@ -64,3 +64,15 @@
         action "/usr/local/etc/rc.d/webcamd start $cdev $interface";
  };

+# Huion pad
+notify 100 {
+       match "system"          "USB";
+       match "subsystem"       "INTERFACE";
+       match "type"            "ATTACH";
+
+       match "vendor"          "0x256c";
+       match "product"         "0x006e|0x006d";
+
+       action "/usr/local/etc/rc.d/webcamd start $cdev $interface";
+};
+
-----

3. Add an InputClass for xorg (taken from a Linux driver):
-----
% cat /usr/local/etc/X11/xorg.conf.d/huion.conf
Section "InputClass"
         Identifier "Huion tablets with Wacom driver"
         MatchUSBID "5543:006e|256c:006e|256c:006d"
         MatchDevicePath "/dev/input/event*"
         MatchIsKeyboard "false"
         Driver "wacom"
EndSection
-----

4. Start hald as well as webcamd.

The end result is:
-----
% xsetwacom --list devices
   Pen stylus                            id: 12  type: STYLUS
   Pad pad                               id: 13  type: PAD

% xinput list
⎡ Virtual core pointer                         id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer 
(2)]
⎜   ↳ System mouse                              id=6    [slave  pointer 
(2)]
⎜   ↳ IntelliMouse                              id=9    [slave  pointer 
(2)]
⎜   ↳ Logitech USB Receiver                     id=11   [slave  pointer 
(2)]
⎜   ↳   Pen stylus                               id=12   [slave  pointer 
  (2)]
⎜   ↳   Pad pad                                  id=13   [slave  pointer 
  (2)]
⎣ Virtual core keyboard                        id=3    [master keyboard (2)]
     ↳ Virtual core XTEST keyboard               id=5    [slave 
keyboard (3)]
     ↳ System keyboard multiplexer               id=7    [slave 
keyboard (3)]
     ↳ AT keyboard                               id=8    [slave 
keyboard (3)]
     ↳ Logitech USB Receiver                     id=10   [slave 
keyboard (3)]
-----

Mind spaces at the "Pad pad" name. Because the following command won't work:
-----
% xsetwacom set "Pad pad" Button 10 "key ctrl Z"
Cannot find device 'Pad pad'.
-----

However spaces make it to do the job:
-----
% xsetwacom set "  Pad pad" Button 10 "key ctrl Z"
%
-----

So at the end of the day I've got a system capable of commenting PDF 
files. Okular is good enough here. Huion pads seems to be a good peace 
of hardware. Fnd a bit cheeper then the other company ones. ;-)

Have a nice day.
-- 
WBR, bsam


More information about the freebsd-questions mailing list