Pencil Code Reference > dblclick
dblclick is an event-handler function. When a user clicks on the screen with the mouse, a function is called and an action is performed.dblclick is the same as click in every way except the way it's called. click runs every time the mouse is clicked, whereas dblclick responds only if the mouse is quickly clicked twice.
dblclick (e) -> #line 1 #line 2 #line 3 #...
e is the location the mouse was clicked. This can be used as a location in commands such as moveto, jumpto, turnto, etc.Below is the same code found on the click page, but it uses dblclick instead.
speed Infinity
ht()
a = 0
dot lightblue, 10000
label a, { fontSize: 60, fontFamily: "Consolas" }
dblclick ->
cs()
dot lightblue, 10000
a += 1
label a, { fontSize: 60, fontFamily: "Consolas" }
↑