I recently posted on this topic to the public dojo/dijit forums but am now casting it to the blogosphere in hope of synergistic bliss (AKA "readers correcting my misunderstandings").
User interaction with a dijit is enabled by our listening for events such as:
4. keypress (fixed/normalized in dojo/_base/event.js)
The interesting thing about click is that it is abstract and device agnostic. For example an html checkbox onclick will be called under the following conditions:
On Firefox, space key up, and left mouse button up.
On Webkit, space key down, left mouse button up.
On IE7, space key up, left mouse buttion up.
In an onclick handler we don't know and presumably are not supposed to care what caused the event.
Right now, in dijit, we have a mixture of device agnostic handling (via onclick), and device speciifc handling (via onmouse__ and onkey__). This means we can't reasonably provide UI/Ux consistency of control.
Note to self: one thing I need to check out is the status of (on)click support for all elements via keyboard and mouse.
In other words, sometimes a user might activate something by pressing space, and another time, on another dijit, by releasing space. This can lead to dangerous things like stray events activating unsuspecting buttons (see related dojo ticket:3281, and firefox bug:384601).
What can we do about this?
Simon and I have discussed this a bit yesterday and have some ideas, such as rewriting/normalizing click if necessar, and perhaps enabling it for nodes the browser implementation might not.
[I've edited this post slightly since the original]