logoalt Hacker News

Rygiantoday at 6:45 AM2 repliesview on HN

Because in those contexts, the Space key is being used as a physical mirror of the on-screen button, and on-screen buttons are UX'd to perform action when released.

These two interactions should behave identically:

- Hover over a button, press mouse button 1, release button 1.

- Tab over to a button, press spacebar, release spacebar.

Why on-screen buttons are UX'd to behave this way is a logical follow-up question. I'd wager that it gives a means to bail out of the clicking (e.g. by moving the mouse out of the on-screen button before releasing mousebutton 1, or by pressing Esc while having spacebar still depressed).


Replies

regularfrytoday at 6:58 AM

Yes, the bailing-out explanation is right. With a mouse it's intentional that you should be able to push the pointer off the button with the mouse button still pressed to cancel.

chrismorgantoday at 7:06 AM

(Esc while Space is held doesn’t cancel, but Tab does.)

You’re only answering half of the inconsistency: because Enter activates buttons like any other key, on keydown.