TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

JavaScript Madness: Keyboard Events

3 pointsby careyover 12 years ago

2 comments

Keithamusover 12 years ago
Part of DOM Level 3 is a new set of keyboard event attributes[1], including a string value[2] which can make this whole keyboard mess much simpler.<p>Unfortunately none of the browser vendors have implemented this - which I find irritating considering so much time is spent on things like the GamePad API.<p>[1]: <a href="http://www.w3.org/TR/DOM-Level-3-Events/#keys" rel="nofollow">http://www.w3.org/TR/DOM-Level-3-Events/#keys</a> [2]: <a href="http://www.w3.org/TR/DOM-Level-3-Events/#key-values-list" rel="nofollow">http://www.w3.org/TR/DOM-Level-3-Events/#key-values-list</a>
bdfh42over 12 years ago
And then there is the question of what an "event" signifies. I noticed the other day in testing a web app that the Windows Phone 7 browser fires the "keyup" event before the character of the key is added to the relevant text box value - while all other browsers I have tested update the text box value before firing "keyup" (although after "keydown" of coure).<p>Just a thought: Is it fair to characterise this as JavaScript madness and not DOM variations?