🧪 Version 0.2.2 is our alpha release candidate. Please send us bug reports and suggestions!

Sketchingpy

Creative coding and interactive science everywhere for everyone: web, desktop, mobile, Jupyter, and more. Open source!

Reference for get_keyboard

Get access to the keyboard. This is part of the reference section.

Purpose

Get access to the keyboard currently registered with the operating system for the sketch. Different sketches running at the same time may have different keyboards depending on focus or OS configuration. Returns None if not supported on the platform or a mouse or equivalent is not connected.

Snippet

Get the current keyboard.
sketch.get_keyboard()

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.

See also