Mouse Drag

Events Block - Forms/Workspace

Description

The Mouse Drag event block performs a list of blocks when the computer mouse button is down and the mouse is moved. Updates to the screen are suspended while the mouse is dragging although realtime events occur. The Mouse Drag event is commonly used to make on-screen joysticks.

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 Drag block does not generate any escapes.

Examples

This example records the path the mouse moved while the mouse button was held down.......

... producing this when the mouse is released:

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 Down
Mouse Up
Mouse Position X
Mouse Position Y
Set Coordinate Frame