Reference for on_key_release
Specify callback for when a key is released. This is part of the reference section.
Arc
Buffer
Data
Dialog
Ellipse
Geo Utils
Image
Joystick (future)
Keyboard
on_key_release
Line
Mouse / Touchscreen
Pixel
Rectangle
Renderers
Shape
Sound (future)
Style
System
Text
Transform
Purpose
Register a callback for when a key is unpressed, calling a function with the key and keyboard. Will pass Button as argument. Will unregister prior callbacks for on_key_release.
Snippet
Register a simple keyboard key callback.
callback = lambda button: print(button.get_name()) sketch.get_keyboard().on_key_release(callback)
Parameters
- callback: The function to invoke when a key is released.
Examples
Availability
Available for Sketch2DApp and Sketch2DWeb. Note that, on web, some keys may be intercepted by the operating system like the ctrl key and may not be available to the sketch.