w3c / uievents

UI Events
https://w3c.github.io/uievents/
Other
145 stars 51 forks source link

Pen Button Events #237

Open gked opened 5 years ago

gked commented 5 years ago

Moving this issue into UI events as it seems to be a more appropriate place for it. @garykac let me know if you disagree.

To reiterate though: Today, it is impossible for a web app to detect when an user presses the top button on a surface pen. Native apps like PowerPoint can register for pen button events to, for example, advance a slide show. Web PowerPoint should be able to do the same.

Is there any opposition to standardizing events such as penbuttonclick, penbuttondblclick, penbuttonpressandhold to enable such scenarios? Are there standards already being discussed that are applicable?

@snianu as FYI

wrightwriter commented 1 year ago

this would be awesome for drawing apps

patrickhlauke commented 1 year ago

i'd need to test this, but I think it's already possible to detect presses of the eraser button on surface pen by checking pointermove events with a button value of 5? https://w3c.github.io/pointerevents/#the-button-property

T0RNATO commented 10 hours ago

i'd need to test this, but I think it's already possible to detect presses of the eraser button on surface pen by checking pointermove events with a button value of 5?

If the eraser button is being used to draw on the screen, yes, but not when holding far away and pressing the eraser button which is a separate thing.