focused#

Confirms if a py5 program is “focused,” meaning that it is active and will accept mouse or keyboard input.

Examples#

1def setup():
2    if py5.focused:
3        py5.ellipse(25, 25, 50, 50)
4    else:
5        py5.line(0, 0, 100, 100)
6        py5.line(100, 0, 0, 100)

Description#

Confirms if a py5 program is “focused,” meaning that it is active and will accept mouse or keyboard input. This variable is True if it is focused and False if not.

Underlying Processing field: focused

Updated on November 12, 2021 11:30:58am UTC