Reference for get_mouse
Get access to the mouse. This is part of the reference section.
Arc
Buffer
Data
Dialog
Ellipse
Geo Utils
Image
Joystick (future)
Keyboard
Line
Mouse / Touchscreen
get_mouse
Pixel
Rectangle
Renderers
Shape
Sound (future)
Style
System
Text
Transform
Purpose
Get access to the mouse currently registered with the operating system for the sketch. Different sketches running at the same time may have different mouse objects depending on focus or OS configuration. Returns None if not supported on the platform or a mouse or equivalent is not connected. May also be emulated if the device uses a touch screen.
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.