-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pen Events API #553
Comments
Mouse has press and release events, but here you are only having a pressandhold, so you can not use it for pressing and dragging pen to select regions or text. Wouldn't it be better to have those instead? |
Thanks for bringing this to our attention. Including the comment above, here are the questions we have.
|
@kenchris and myself took another look at this issue during our "Kronos" VF2F. Given there hasn't been any traction on the comments left to authors above, we opened new issues in the Microsoft Edge Explainers repro and will review again once they have been addressed. |
@kenchris @cynthia @atanassov thanks for your your patience. Your originally posted questions slipped my attention. RE: this comment from @kenchris and question 1 from @cynthia:
This section in the explainer covers why:
RE: question 2 on the necessity of connect:
The reason is explained in the System Interactions section:
In Windows you can configure the behavior of the pen button events and opt to let apps override those behaviors. The configuration UI looks like this: Calling RE: question 3 on the need for a disconnect event:
The response to question 2 may have already made the purpose of connect more clear: connect isn't connecting to the pen, its registering the intent of the app to override system behaviors. If the pen's bluetooth connection is interrupted, the web app doesn't need to call connect again. RE: question 4 on blurred web pages with connected
I tried to cover that under the second paragraph of System Interactions
Basically only |
@BoCupp-Microsoft. apologies this took so long. @atanassov and I discussed this during our F2F.
We're not really sure designing an API around a hardware limitation is a good idea. Feels like it would make sense to design a generic API and produce synthetic events for cases where hardware limitations disallow implementing certain features. (e.g. like how touch -> mouse was done) Additionally, re-reading the explainer, it also seems like Pointer Events is being used to communicate button presses? In that case what are the three special button events for? Having to detect button presses in two different ways seems unintuitive. 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. Have you discussed this with other implementors? |
@BoCupp-Microsoft any update to our comments? |
@darktears as you are on top of the USI standard, does that cover any of this? |
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). I believe the reason Microsoft went this way is because the Surface Pen delivers its events not only through the digitizer but also with bluetooth when not in range with the screen (for the buttons/gestures they're talking about). And I'm assuming that when not in range the events are probably not coming through standard window message (WM_POINTER_DOWN etc) thus why they thought on an additional API because the underlaying API requires to create a separate connection. Today as far as I can remember in Chromium, Pointer Events are delivered when the pen/stylus is able to communicate with the digitizer but that's an implementation limitation, I don't think it's written anywhere that pointer events could not be dispatched even if the stylus isn't in range with the digitizer. Now of course if we start to dispatch pointer events just for button state changes it begs the question of what would be the values of the other Pointer Events attributes provided we have no way to fetch them until the stylus is in range with the digitizer (e.g. position, tilt, pressure etc). Maybe we could add an attribute to the events to represent whether the stylus is in range with the digitizer. This would make quite clear that the values depending on being in range will be set to 0. That way you could still propagate the button state changes. |
@cynthia and @darktears, regarding the following:
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" and the "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.
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 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 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 and this related commit. I could also see the proposed
It looks like we did make a request for position here 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. |
Thank you for getting back to us, and apologies this took so long. While we aren't entirely satisfied with the outcome of the discussion, we also would prefer not to block work from happening. If you have future iterations which warrants a second round of reviews, feel free to request us to reopen. Thank you for bringing this to our attention. |
Thanks for your consideration and comments. |
Saluton TAG!
I'm requesting a TAG review of Pen Events.
Some digital pens and pencils can not only provide input through their interaction with a digitizer but can also pair with a device so that additional signals can be received when a button is pressed. In some cases, the signal may relate to the pen or pencil but come from another source, e.g. a charger may send a signal that the pen or pencil has been docked or undocked. Native applications can use these signals to customize their behavior, but no corresponding events are available to web applications. Providing these new pen event primitives would enable web applications to achieve parity with native applications.
Further details:
We'd prefer the TAG provide feedback as (please delete all but the desired option):
🐛 open issues in our GitHub repo for each point of feedback
The text was updated successfully, but these errors were encountered: