w3c / uievents

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

keydown event should have an attribute which is set to true when it's followed by a beforeinput or keypress event? #179

Open masayuki-nakano opened 6 years ago

masayuki-nakano commented 6 years ago

Although I suggested same or similar thing already. However, I meet this issue again because I'm working on preparing to stop dispatching keypress events for non-printable keys on Gecko.

When I need to handle both non-printable keys and printable keys and I shouldn't kill following keypress event for compatibility, I need to handle keydown event only when it won't be followed by keypress event but otherwise, keydown event is the last chance to handle it.

This is not necessary for web apps, probably. However, when implementing default action (including implemented by extensions), this is really important. In this purpose, I need to distinguish if the key or key combination is printable (i.e., followed by keypress events).

So, I want KeyboardEvent.isPrintable, KeyboardEvent.isInputtingText or something as boolean attribute. How do you thing, @garykac?