Guidance needed : creating gesture events from touch events

13 views
Skip to first unread message

Andrew B. Holbrook

unread,
Apr 6, 2018, 2:05:59 AM4/6/18
to inpu...@chromium.org
Hi!

First, my apologies if this is an improper use of this group.

I am trying to leverage chromium (via electron) to remap a touch screen and send those touches to the browser.  Basically this means I am creating the WebTouchEvents through code and passing them on.

I have been successful at seeing touchstart, touchmove, and touchend, as well as some pointer events in the browser.  However, I'm not able to scroll, click, or do anything that I suspect come from the gesture engine.

To process the touch event, I am sending it to the ProcessTouchEvent function that's a part of the RenderWidgetHostView class.  Does that not automatically look for gestures?

Thanks!
Andrew

PhistucK

unread,
Apr 6, 2018, 6:28:56 AM4/6/18
to Andrew B. Holbrook, input-dev
I know nothing, but WebTouchEvents sounds to me like a concept in a much higher-level part of the stack than the original touch events. Because the (renderer or browser...) compositor handles scrolls sometimes/often (especially on touch screens), I would expect the gesture to be detected in a lower-level part of the stack, closer to the raw event than to the renderer/webby stuff/Blink.


PhistucK

--
You received this message because you are subscribed to the Google Groups "input-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to input-dev+unsubscribe@chromium.org.

Tim Dresser

unread,
Apr 6, 2018, 8:12:57 AM4/6/18
to PhistucK, Andrew B. Holbrook, input-dev
You need to inject the input in the browser.

See OnEventFromSource.

To unsubscribe from this group and stop receiving emails from it, send an email to input-dev+...@chromium.org.

Dave Tapuska

unread,
Apr 6, 2018, 10:01:56 AM4/6/18
to Tim Dresser, PhistucK, andrew....@gmail.com, input-dev
I'm not entirely certain on your model, are you using another process that owns the touch screen to send input back to another browser process? If so this sounds like you want mutli-process communication and then I'd say to use the devtools protocol to inject your touch events.

But if you aren't multi-process then you might be able to do this on the platform level looking at non-client touch event streams. For example the code is here on Windows.

An alternate is you can look at the TouchEmulator class that devtools uses for the emulation mode. It generates scroll events from mouse events.

dave.


Andrew B. Holbrook

unread,
Apr 6, 2018, 2:04:22 PM4/6/18
to Dave Tapuska, Tim Dresser, PhistucK, input-dev
All,

Thanks for the guidance on places to look.  Without obviously knowing how all of this works :) I appear to be on the right path.

In my class that is sending the Touch Events to the browser, I've added a GestureProvider object and also classed the main class as a GestureProviderClient.  I then pass my touch objects into the GestureProvider, and it is returning to me the Gestures, which I can then pass on to the browser, using the TouchEmulator code as an example.  My initial scroll and tap tests worked!!

Regards,
Andrew

To unsubscribe from this group and stop receiving emails from it, send an email to input-dev+unsubscribe@chromium.org.

--
You received this message because you are subscribed to the Google Groups "input-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to input-dev+unsubscribe@chromium.org.

Reply all
Reply to author
Forward
0 new messages