Name

focused

Description

Confirms if a Processing program is "focused", meaning that it is active and will accept input from mouse or keyboard. This variable is true if it is focused and false if not.

Examples

  • if (focused) {  // or "if (focused == true)"
      ellipse(25, 25, 50, 50);
    } else {
      line(0, 0, 100, 100);
      line(100, 0, 0, 100);
    }