Input event notify or injection in Weston
Josh Simonot
jsimonot at live.ca
Fri Dec 6 19:51:33 UTC 2019
Hello,
I have the need to pass input events from a hypervisor host into a guest running weston. I already have a custom protocol in weston to share surfaces with the host, and I'm hoping it makes sense to extend it to send input back to the guest.
So does it make sense to route these input events through libweston? I've found the functions: notify_key(), notify_button(), notify_motion_absolute(), etc. I was trying to use these to inject the events but end up causing weston to segfault:
[22:14:37.440] caught signal: 11
[22:14:37.442] [0000000000405c9a] -- (weston)
[22:14:37.442] [0000000000405d07] -- (weston)
[22:14:37.444] [00000034a0e34380] -- (/lib/libc.so.6)
[22:14:37.446] [00000034a321a380] notify_button (/usr/lib/libweston-3.so.0)
[22:14:37.447] [00007ff73b747302] -- (/usr/lib/libweston-3/drm-backend.so)
[22:14:37.449] [00000034a1207477] -- (/lib/libpthread.so.0)
[22:14:37.450] [00000034a0ef23bf] clone (/lib/libc.so.6)
I suspect I don't have a valid weston_seat, which I get like this:
struct udev_seat *udev_seat = udev_seat_get_named(input, "default");
struct weston_seat *seat = &udev_seat->base;
Where "default" is the only existing seat in the list. I didn't create or add any.
1. Is this the right approach? Any hints on how to make it work?
2. One alternative I'm considering is to use uinput to create virtual input devices and send the events to that. Any other alternatives that might be more appropriate than the above?
Thanks!
-JS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20191206/5f4f553c/attachment.html>
More information about the wayland-devel
mailing list