Lingo Dictionary > D-F > doubleClick |  |

doubleClick

Syntax

    the doubleClick

Description

Function; tests whether two mouse clicks within the time set for a double-click occurred as a double-click rather than two single clicks (`TRUE`), or if they didn't occur within the time set, treats them as single clicks (`FALSE`).

Example

This statement branches the playback head to the frame Enter Bid when the user double-clicks the mouse button:

    if the doubleClick then go to frame "Enter Bid"

Example

The following handler tests for a double-click. When the user clicks the mouse, a repeat loop runs for the time set for a double-click (20 ticks in this case). If a second click occurs within 20 ticks, the `doubleClickAction` handler runs. If a second click doesn't occur within the specified period, the `singleClickAction` handler runs:

    on mouseUp
    	if the doubleClick then exit
    	startTimer
    	repeat while the timer < 20
    		if the mouseDown then
    			doubleClickAction
    			exit
    		end if
    	end repeat
    	singleClickAction
    end mouseUp

See also

`clickOn`, `the mouseDown (system property)`, `the mouseUp (system property)`