Virtual Touch Events for XTEST

Peter Hutterer peter.hutterer at who-t.net
Thu Feb 23 22:27:35 UTC 2017


On Thu, Feb 23, 2017 at 02:16:40PM +0700, Antoine Martin wrote:
> On 23/02/17 09:59, Peter Hutterer wrote:
> > On Wed, Feb 22, 2017 at 12:25:07PM +0530, Prakash P wrote:
> >> ​​
> >> Hi,
> >>
> >> I want to create an virtual test environment for my web application. I got
> >> it working with the help of xvfb and running google-chrome inside it. I am
> >> able to send keytrokes and mouse events through the xdotool
> >> http://www.semicomplete.com/projects/xdotool which internally uses XTEST.
> >>
> >> I do have some test cases where I have to send touch events to the chrome
> >> browser. Unfortunately the xdotool does not support sending touch events. I
> >> am unable to find any info about whether XTEST supports touch events or not..
> > 
> > it doesn't support touch events, so going down that route isn't possible.
> > 
> >> I tried creating a "virtual touch device" using user mode input subsystem
> >> "uinput" which works only on the logged in x-org session. I am able to send
> >> touch events [Code attached in the bottom].
> >>
> >> But the Xvfb dont care about the virtual uinput devices the "xinput list"
> >> revealed only the following.
> >>
> >>> sudo DISPLAY=localhost:2.0 xinput list
> > 
> > xvfb only initializes dummy input devices that don't do anything.
> > 
> >> *⎡ Virtual core pointer                          id=2    [master pointer
> >> (3)]⎜   ↳ Virtual core XTEST pointer                id=4    [slave
> >> pointer  (2)]⎜   ↳ Xvfb mouse                                id=6
> >> [slave  pointer  (2)]⎣ Virtual core keyboard
> >> id=3    [master keyboard (2)]    ↳ Virtual core XTEST
> >> keyboard               id=5    [slave  keyboard (3)]    ↳ Xvfb
> >> keyboard                             id=7    [slave  keyboard (3)]*
> >>
> >>
> >> I also tried the virtual uinput device with "Xorg X11 dummy video driver"
> >> https://xpra.org/trac/wiki/Xdummy which is also not detecting the my
> >> "virtual touch device" ( I ran the xorg as non root).
> >>
> >>
> >> I am struck. I don't know where to proceed further.
> >> Is there any other options available? Do I have to implement something else?
> > 
> > The only option I can see is to run a full Xorg with the uinput touch
> > device. Short of that, I don't think anything will help.
> Xdummy is a "full Xorg" just running with the dummy video driver.

good point, I forgot about that. Yes, that works, I used X + the dummy
driver for the xorg integration tests and those use various input drivers +
uinput devices.

> This question is very similar to the one I asked last year, also using
> Xdummy:
> https://lists.freedesktop.org/archives/xorg/2016-June/058138.html
> "emit smooth scrolling/pixel perfect events"
> 
> Unfortunately, I didn't understand enough about libinput to make any
> progress on this.
> 
> I did try a few things but since the plumbing between uinput and the
> userspace application handling the events didn't give me any diagnostics
> I could understand, I couldn't really tell if the changes I was making
> were going in the right direction or not.
> Any more noob friendly pointers would be much appreciated.

problem still exists, sorry :)

the problem is that you want smooth scroll events but they're an entirely
made up thing by the driver. uinput is a hardware-emulation so you need to
emulate hardware that looks like the thing that the driver would want to do
smooth scrolling on. That's not trivial and depends a lot on the actual
driver implementation (libinput vs synaptics vs evdev vs...)

The only way you can implement this directly is by having a custom xorg
driver that knows about this. But then it's not really a drop-in option.

Cheers,
   Peter


More information about the xorg-devel mailing list