Using Director > Navigation and User Interaction > Detecting mouse clicks with Lingo |
![]() ![]() ![]() |
Detecting mouse clicks with Lingo
Users can click the mouse button in several ways, each of which Lingo can detect. The following are ways that you can use Lingo to detect what the user does with the mouse.
![]() |
To determine the last place the mouse was clicked, use the |
![]() |
To determine the last active sprite (a sprite with a script attached) that the user clicked, use the |
![]() |
To determine whether the last two clicks were a double-click, use the |
![]() |
To determine the time since the mouse was last clicked, use the |
![]() |
To determine whether the mouse button is pressed, check the |
![]() |
To determine whether the mouse button is released, check the |
![]() |
To determine whether the user presses the right mouse button (Windows) or Control+click (Macintosh), check the |
![]() |
To determine whether the user releases the right mouse button (Windows) or Control+click (Macintosh), check the |
For example, this handler checks whether the user double-clicked the mouse button and, if so, runs the handler openWindow
:
on mouseDown if the doubleClick = TRUE then openWindow end
![]() ![]() ![]() |