Mouse Down

Events Block - Package/Form, Button

Description

The Mouse Down block performs a list of blocks when the computer mouse clicks down on the associated form. The associated list of blocks often reference the Mouse Position X and Mouse Position Y blocks in the Graphics category. The Mouse Down event is commonly used to make on-screen joysticks or to measure coordinates on a constructed graph.

These blocks are unique to each Package/Form. When the Event is dragged from the list on the left onto the Workpage it is removed from the list on the left. If you attempt to duplicate the block you receive this error:

Escapes

The Mouse Down block does not generate any escapes.

Examples

This example shows mouse coordinates being reported when a form is clicked.....

... producing this:

This workpage of blocks illustrates how an on-screen joystick can be made that moves a motor at a speed proportional to the mouse click position's deviation from the center of the form either positive or negative:

Related Topics

Mouse Drag
Mouse Up
Mouse Position X
Mouse Position Y
Set Coordinate Frame