Re: [uievents] How do web apps distinguish if a keydown event causes text input? (#18)

And also there is another use case of this (I forgot to say this):

I cannot suggest a realistic scenario, though. Currently, web apps cannot distinguish if the KeyboardEvent is inputting text or representing a non-printable key event with KeyboardEvent.key.

For example, web apps might check with this logic:
if (event.key.length > 1) {
  // non-printable key
} else {
  // printable key
}

But this is wrong in some cases if a key causes two or more characters. E.g., when the .key value is non-BMP character, including IVS or something similar code.

---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/uievents/issues/18#issuecomment-152054671

Received on Thursday, 29 October 2015 02:30:16 UTC