Skip to content

Comment on P99 0 ms* autocomplete for 240M domain namesparent

Comments

Give me an example. Any example beyond this Space one we’re discussing; because I don’t know of any.

Examples where key down is used as an input event?

Basically anything that requires text input from OS-native text input fields to IDEs, word processors, spreadsheets, web browsers, terminal emulators and so on and so forth.

Key UP!

(I confess I’m getting frustrated at the ridiculously large fraction of messages in this thread that have somehow completely misunderstood things.)

Your message was ambiguous to me. But I will admit that I was also quite hungover so it’s possible that the error was mine.

In answer to your question: I’ve only really used keyup for either one time events (like keyboard shortcuts for UI elements) and for ending the status of repeated events (eg movement in games, dragging UI elements, etc).

I think if you were to search for key up events in GitHub, most of references might likely be games and other visual interactions rather than text entry.

I can see both viewpoints here and don’t have a strong personal view

But for reference browsers fire the keypress event on keyup

If supported by a user agent, this event MUST be dispatched when a key is pressed down [...]

https://w3c.github.io/uievents/#event-type-keypress

The keypress event is an ancient mistake that I think never had any legitimate use case, and has been deprecated for quite some time now.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.