Reference for get_name (Trigger)
Get the identifier for a discrete input on a joystick-like device. This is part of the reference section.
Arc
Buffer
Data
Dialog
Ellipse
Geo Utils
Image
Joystick (future)
get_name (Trigger)
Keyboard
Line
Mouse / Touchscreen
Pixel
Rectangle
Renderers
Shape
Sound (future)
Style
System
Text
Transform
Purpose
Get the name of a "discrete input" on a joystick-like device. Sketchingpy refers to these as triggers. For example, "push0" refers to the first push button on the device.
Snippet
Register a callback for when the state of a trigger changes on the first joystick.
def print_trigger(trigger): print(trigger.get_name()) joysticks = sketch.get_joysticks() first_joystick = joysticks[0] first_joystick.on_state_change(print_trigger)
Availability
Not yet available. Planned for future release.