Eng:Mouse Down? (block)

The Mouse Down? block is a Sensing block and a Boolean block. The block checks if the computer mouse's primary button is activated (being clicked).

Example Uses
As this block checks if the mouse is being clicked, it is useful for simulating clicks anywhere, even on the scripting area (not perfectly, however) and especially with one sprite one script projects; if the project requires clicking, this block can be used to serve as a replacement for the When Clicked block, as the Hat block cannot be used in the middle of a script.

Some common uses for the Mouse Down? block:
 * Sensing when an object should be lifted with the Not block (when the mouse is not held anymore)

forever if  then wait until > repeat until  go to [mouse-pointer v] end wait until >


 * Sensing with draggable objects


 * Recording mouse clicks

when gf clicked reset timer forever if  then set [down v] to (timer) wait until > set [up v] to (timer) set [elapsed v] to ((up) - (down)) add (down) to [mouse-downs v] add (up) to [mouse-ups v] add (elapsed) to [down times v]

Variants
In some Scratch modifications, there are similar blocks which allow the user to detect other mouse buttons; either the right-click or left-click button.

Some Scratchers wanted this feature to be implemented in Scratch itself.