Re: [w3ctag/design-reviews] Pen Events API (#553)

@cynthia and @darktears, regarding the following:
> I agree with @cynthia that it sounds weird to have a separate set of events for button presses when the Pointer Events deliver those (and if they don't fit the bill, we should expand these).

PointerEvents don't seem like a good semantic match for pressing a button on a pen.  Under the alternatives considered section of the explainer both the "[Dispatching Additional PointerEvents](https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/PenEvents/explainer.md#dispatching-additional-pointerevents)" and the "[Dispatching of Existing PointerEvents](https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/PenEvents/explainer.md#dispatching-of-existing-pointerevents)" sections cover why.  PointerEvents relay some interaction with the screen.  PenButtonEvents are screen independent and relay information about interaction with buttons on the pen, not contact (or near contact) with the screen.

> We're not really sure designing an API around a hardware limitation is a good idea...
> Re. the connect() behavior, this is Windows-specific behavior that is being superimposed onto the web and I don't think that's something we are comfortable with.

It doesn't appear to me that the hardware limitation or the need to override system behaviors for a pen interaction are unique to Windows.  Exhibit A (for Apple): The Apple pencil seems to have [similar APIs](https://developer.apple.com/documentation/uikit/pencil_interactions) that apps could handle for the double-tap gesture (which by default switches tools or does something else as configured in iPadOS settings).  I could see the Apple pencil exposing its double-tap gesture to the web and signaling that its been overridden by the web app via the proposed `dblclick` event and `connect` API.

Similarly, it looks like Chrome OS also generates a unique key event (like Windows) for a Bluetooth double-click button on a stylus as mentioned in [this article](https://chromeunboxed.com/chromebook-usi-pen-stylus-buttons-actions) and this [related commit](https://chromium-review.googlesource.com/c/chromium/src/+/2079836/9/ash/system/palette/tools/create_note_action.cc).  I could also see the proposed `dblclick` event and `connect` API being a good fit here if the OS wanted to allow authors to override the built-in behavior like iPadOS and Windows can.

> Have you discussed this with other implementors?

It looks like we did make a [request for position here](https://github.com/mozilla/standards-positions/issues/190) and that Apple and Mozilla are trending towards not interested.  I'd like to circle back with them to see if that's the their final word on the matter.  The primary concern seems to be that this might be too hardware-specific, yet I see multiple platforms that all have similar capabilities that could be made available to the web through this API.  I'm not sure if that was well understood at the moment we originally released the explainer and those comments were made.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3ctag/design-reviews/issues/553#issuecomment-993207117

Received on Tuesday, 14 December 2021 06:40:25 UTC