I did some playing around here with touch2pointer
and I think I found the source of confusion. First of all we do have some short documentation on touch2pointer
usage but it appears to be somewhat outdated/incorrect: Working with Weston on TorizonCore | Toradex Developer Center
One aspect that is still correct is that you should create a udev rule like so:
SUBSYSTEM=="input", KERNEL=="event0", ENV{LIBINPUT_IGNORE_DEVICE}="1"
Use the correct event*
identifier that corresponds to your touchscreen instead of event0
. What this does is make it so that Weston doesn’t react to your touchscreen. That way when touch2pointer
is running only the simulated pointer input is taken into account and not the original touch input. That should fix this issue you mentioned here:
However, this exposes a new issue, which is that weston processes events from both input sources, resulting in duplicate clicks for controls that can accept touch input events.
Next I ran touch2pointer
inside a Weston container. It is then I noticed you were correct about your statement with there being an issue in the entry script:
The entry.sh
script also seems to have a bug:
I’ll bring this up with our team.
In lieu of this bug I spun up a container like so:
docker run -d --privileged --rm --name=weston --net=host --cap-add CAP_SYS_TTY_CONFIG -v /dev:/dev -v /tmp:/tmp -v /run/udev/:/run/udev/ --device-cgroup-rule='c 4:* rmw' --device-cgroup-rule='c 13:* rmw' --device-cgroup-rule='c 226:* rmw' torizon/weston:$CT_TAG_WESTON --developer --tty=/dev/tty7
I used --privileged
for blanket permissions for testing purposes, but feel free to narrow the permissions in your case as needed. I then used docker exec
to get a shell inside the container and manually executed touch2pointer
like this: touch2pointer /dev/input/event5
The virtual input event6
was then created and available in the container since I bind-mounted all of /dev
. I was then able to use my touchscreen as a mouse input, this was signified by the mouse cursor following my touch, whereas before it did not.
Therefore it seems like you can make use of touch2pointer
with a single container by just bind-mounting all of /dev
. That way when the new virtual event*
device is created the container will have access to it while it’s already running.
Best Regards,
Jeremias