Reference for get_name (Mouse)
Information about a mouse button. This is part of the reference section.
Arc
Buffer
Data
Dialog
Ellipse
Geo Utils
Image
Joystick (future)
Keyboard
Line
Mouse / Touchscreen
get_name (Mouse)
Pixel
Rectangle
Renderers
Shape
Sound (future)
Style
System
Text
Transform
Purpose
Get information about mouse button or an emulated button in the case of a touch screen. Uses the following names:
Note that scrollwheel events are not currently supported due to complications with web.
Mouse | Touchscreen | Value | Constant |
---|---|---|---|
Left Button | Single Finger Tap | 'leftMouse' | sketchingpy.const.MOUSE_LEFT_BUTTON |
Right Button | Two Finger Tap | 'rightMouse' | sketchingpy.const.MOUSE_RIGHT_BUTTON |
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.