q5play
    Preparing search index...

    Function keyIsDown

    • 🖲 Returns true if the user is pressing the specified key, false otherwise. Accepts case-insensitive key names.

      Parameters

      • key: string

        key to check

      Returns boolean

      true if the key is pressed, false otherwise

      q5.draw = function () {
      background(0.8);

      if (keyIsDown('f') && keyIsDown('j')) {
      rect(-50, -50, 100, 100);
      }
      };