Hi Rick & input-dev team,
On Wed, 2015-01-07 at 10:32 -0500, Rick Byers wrote:
> +input-dev team
>
>
> Hi Rob.
> Thanks, that's great! I've hoped to expose some additional
> stylus-type properties on TouchEvent for awhile, but the standards
> situation here is quite difficult (with some vendors backing the
> pointer events API). We don't add new non-standard APIs to blink, so
> the standards process is the real gate here. You can follow along and
> participate in the Touch Events Community Group if you're interested.
Thanks, i've subscribed to the mailing list now to keep an eye out for
updates on this.
>
> That said, we already have something that kind of works on Android
> with stylus input. There we send touch events for the stylus, and
> plumb things like stylus pressure through to TouchEvent.force. The
> main functionality that's missing with that is an inability to tell
> where the stylus is when it's not contacting the screen. As a
> workaround (until we have a better API), we send mousemove events in
> that scenario. This has been good enough for users in practice for
> awhile. You can see this behavior, for example, on a Samsung Galaxy
> Note with their SPen.
>
>
> So first step is definitely getting ChromeOS to parity with our
> Android behavior here. The additional steps on top of that are
> tracked in that bug and this document.
>
After wrangling with the I2C driver i've now got both the touchscreen
and the stylus working on my hardware. The implementation I made for the
external tablets works with zero modifications with the on screen
stylus.
This code currently generates MouseEvent (as in ui/events) for movement
and button press/release and moves the mouse cursor. Currently this
cursor is the usual arrow.
If I understand the Android SPen behaviour correctly I need to change
this to:
- Generate MouseEvent (ET_MOUSE_MOVED) when the stylus is in proximity
but not touching the screen (as currently so no change)
- Generate TouchEvent, ET_TOUCH_PRESSED/RELEASED when pressing &
releasing and ET_TOUCH_MOVED when dragging.
- Plumb the stylus pressure in as the touch event force.
Couple of implementation questions:
- Should the cursor move with the stylus? Perhaps it should be some
other graphical representation, like a cross hair (that's what I
observed on Windows 8.1)
- What shall we put for the radius of the touch event, zero?
- When some mechanism for identifying that this is a stylus vs a finger
comes into blink we'll also need to extend TouchEvent.
Rob