Reference for on_button_release
Specify callback for when a mouse button is released. This is part of the reference section.
Arc
Buffer
Data
Dialog
Ellipse
Geo Utils
Image
Joystick (future)
Keyboard
Line
Mouse / Touchscreen
on_button_release
Pixel
Rectangle
Renderers
Shape
Sound (future)
Style
System
Text
Transform
Purpose
Register a callback for when a button is unpressed, calling a function with the button and mouse. Will pass Button as argument. Will unregister prior callbacks for on_button_release.
Snippet
Register a simple click callback.
callback = lambda button: print(button.get_name()) sketch.get_mouse().on_button_release(callback)
Parameters
- callback: The function to invoke when a mouse button or equivalent is released.
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.