I have an Android app which I'm running on a Chromebook. I have views which scale with pinch-and-zoom gestures when the user touches the device's screen, and these work fine on the Chromebook. I'm trying to get pinch-and-zoom working with the touchpad as well.
I can three-finger drag scrollable elements. I can two-finger drag and it drags around screen elements where dragging makes sense. I still get hover events and the events claim there are two pointers, so that's all good. However, as soon as the fingers start moving in opposing directions, the event stream stops.
Is there any way I can get the unfiltered everything input event stream so I can see what's going on? I feel like the emulation layer's best-effort attempt to make everything "just work" (and it's a really good effort!) is biting me here. I also notice that some events are coming in as generic motion events, and some are coming in as touch events. And some, like tap-to-click do some of each. If it matters, the input device data for ChromeOS Mouse
claims it has the ( touchscreen mouse )
sources, which mostly makes sense. Except shouldn't it be touchpad
instead since it's not directly attached to a display?
On this page, list item #5 implies that some kind of synthetic event might be created and used somehow. Is there any way to see if those are being generated? And if yes, how would I take advantage?
Help!
A little more detail: Single finger operation of the touchpad gives me ACTION_HOVER_MOVE
generic events. Two-finger drag gives me ACTION_MOVE
touch events so long as both fingers are moving together. As soon as they start heading in different directions, the event stream stops.
Pinch-to-zoom support for Touchpad is still work in progress. Once it is there, it will work seamlessly with the standard gesture recognizer used for touchscreen zoom as well, you should not have to do anything.
I can highly recommend upgrading to API level 24 if you want to target Chromebooks, there are also more details on input devices on Chromebooks to be found here: https://developer.android.com/topic/arc/input-compatibility.html
edit: The "touchpad" device type is very confusingly named. It is reserved for off-screen devices. The touchpad is treated as a mouse since it moves the mouse cursor on screen.