focused

focused

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

Examples

1
2
3
4
5
6
def setup():
    if py5.focused:
        py5.ellipse(25, 25, 50, 50)
    else:
        py5.line(0, 0, 100, 100)
        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