logoalt Hacker News

hnlmorgtoday at 7:22 AM1 replyview on HN

Key down is used for events that can be duplicated by holding the key. Eg in a text editor, when you want multiples of the same letters, you’d press and hold the key.

Key up is used for when it’s important to only have one occurrence of that event.

Technically you could write code that made key down only react once. But the logical separation makes some sense.


Replies

chrismorgantoday at 8:44 AM

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

show 2 replies