Py5MouseEvent.get_count()#

Get the number of mouse clicks.

Examples#

 1def setup():
 2    py5.size(200, 200, py5.P2D)
 3    py5.rect_mode(py5.CENTER)
 4
 5
 6def draw():
 7    py5.square(py5.random(py5.width), py5.random(py5.height), 10)
 8
 9
10def mouse_clicked(e):
11    py5.println('mouse click count:', e.get_count())

Description#

Get the number of mouse clicks. This will be 1 for a single mouse click and 2 for a double click. The value can be much higher if the user clicks fast enough.

Underlying Processing method: getCount

Syntax#

get_count() -> int

Updated on April 27, 2022 10:44:51am UTC