Skip to content

Instantly share code, notes, and snippets.

@chopin1998
Last active December 25, 2024 03:24
Show Gist options
  • Save chopin1998/7c1d00df3d19f94cb5658f2b81427a5b to your computer and use it in GitHub Desktop.
Save chopin1998/7c1d00df3d19f94cb5658f2b81427a5b to your computer and use it in GitHub Desktop.
Setup HUION L610 (Inspiroy Frego) under LinuX
Huion L610 (绘王 Inspiroy Frego) is a good tablet.
But for now (2024-12-24), its firmware has a bug (i think) that as default mode the upper button on pen is un-useable.
dump using evtest:
// tip touch
Event: time 1734945664.049126, type 4 (EV_MSC), code 4 (MSC_SCAN), value d0042
Event: time 1734945664.049126, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
Event: time 1734945664.141165, type 4 (EV_MSC), code 4 (MSC_SCAN), value d0042
Event: time 1734945664.141165, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
// upper button
Event: time 1734945679.961154, type 4 (EV_MSC), code 4 (MSC_SCAN), value d0043
Event: time 1734945679.961154, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
Event: time 1734945680.161244, type 4 (EV_MSC), code 4 (MSC_SCAN), value d0043
Event: time 1734945680.161244, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0
// lower button
Event: time 1734945817.985139, type 4 (EV_MSC), code 4 (MSC_SCAN), value d0044
Event: time 1734945817.985139, type 1 (EV_KEY), code 331 (BTN_STYLUS), value 1
Event: time 1734945818.285692, type 4 (EV_MSC), code 4 (MSC_SCAN), value d0044
Event: time 1734945818.285692, type 1 (EV_KEY), code 331 (BTN_STYLUS), value 0
you can see upper button has same code (330) for tip touch. i' sorry...
////////
after some research, those solution seems fine.
1. just use hwdb
a) use udevadm info --query=all --name=/dev/input/eventX // to check device path (usb or bt)
b) create a /etc/udev/hwdb.d/99-bt-l610-tablet.hwdb
evdev:input:b0005v256Cp8251*
KEYBOARD_KEY_d0042=330 # tip
KEYBOARD_KEY_d0043=332 # -> upper
KEYBOARD_KEY_d0044=331 # -> lower
c) sudo systemd-hwdb update; sudo sudo udevadm trigger
than you can use upper button as MOUSE RIGHT_BTN (tip touch for LEFT_BTN, and lower for MID_BTN)
2. use uvdev code, for more flexible config, sample like:
import evdev
from evdev import UInput, ecodes
ui = UInput()
device = evdev.InputDevice('/dev/input/event28')
for event in device.read_loop():
if event.type == evdev.ecodes.EV_MSC and event.value == 0xd0043:
ui.write(evdev.ecodes.EV_KEY, evdev.ecodes.KEY_E, 1)
ui.write(evdev.ecodes.EV_KEY, evdev.ecodes.KEY_E, 0)
ui.syn()
////////////////
doNOT use them both !
////////////////
then xinput --map-to-output "Inspiroy Frego M-xxxxxx Pen (0)" yyyyy # to map tablet work screen.
that's all!
hope they can upgrade firmware to fix the bug..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment