🧪 Version 0.3.1 is our alpha release candidate. Please send us bug reports and suggestions!

Sketchingpy

Creative coding and interactive science everywhere for everyone: web, desktop, mobile, Jupyter, and more. Open source!

Reference for Button (Mouse)

Information about a mouse button. This is part of the reference section.

Purpose

Information about a mouse button or equivalent gesture on touchscreen.

Snippet

Get a button currently pressed.
buttons = sketch.get_mouse().get_buttons_pressed()
if len(buttons) > 0:
print(buttons[0].get_name())

Examples

Availability

Available for Sketch2DApp and Sketch2DWeb. Note that, on web, right click may be intercepted by the operating system and may not be available to the sketch or may be delayed.

See also