I have been working on a python based driver to bring back some functionality in some old tablets.
I am initialising as follows
dev.enable(libevdev.EV_REL.REL_X )
dev.enable(libevdev.EV_REL.REL_Y )
dev.enable(libevdev.INPUT_PROP_DIRECT)
dev.enable(libevdev.EV_KEY.BTN_TOOL_PEN)
dev.enable(libevdev.EV_KEY.BTN_TOOL_RUBBER)
dev.enable(libevdev.EV_KEY.BTN_TOOL_MOUSE)
dev.enable(libevdev.EV_KEY.BTN_STYLUS)
dev.enable(libevdev.EV_KEY.BTN_STYLUS2)
dev.enable(libevdev.EV_ABS.ABS_X,libevdev.InputAbsInfo(minimum=0, maximum=Xmax*10,resolution=1270))
dev.enable(libevdev.EV_ABS.ABS_Y,libevdev.InputAbsInfo(minimum=0, maximum=Ymax*10,resolution=1270))
dev.enable(libevdev.EV_ABS.ABS_PRESSURE,libevdev.InputAbsInfo(0,254))
dev.enable(libevdev.EV_ABS.ABS_TILT_X,libevdev.InputAbsInfo(minimum=-64, maximum=64))
dev.enable(libevdev.EV_ABS.ABS_TILT_Y,libevdev.InputAbsInfo(minimum=-64, maximum=64))
dev.enable(libevdev.EV_KEY.BTN_LEFT)
dev.enable(libevdev.EV_KEY.BTN_RIGHT)
uinput = dev.create_uinput_device()
However when
[InputEvent(EV_KEY, BTN_TOOL_MOUSE, 1), InputEvent(EV_SYN, SYN_REPORT, 0)]
is sent, a pen and not a mouse is listed in xinput after this, although subsequent
[InputEvent(EV_KEY, BTN_TOOL_PEN, 1), InputEvent(EV_SYN, SYN_REPORT, 0)]
work, positional data sent is ignored after setting the input tool to mouse again.
only the Pen and eraser work. Am I initializing this wrong somehow ? tested on Ubuntu 20 and FreeBSD 12
from Initializing libevdev in python so that a device can have multiple tools working
No comments:
Post a Comment