Skip to content

check if keyIsPressed === true #5430

@michaeleggers

Description

@michaeleggers

Hello :)
Could we change the docs for keyIsPressed to not be checked against true explicitly?
It is on: https://p5js.org/reference/#/p5/keyIsPressed

How would this new feature help

Avoiding to teach new devs bad coding-habit:

function draw() { if (keyIsPressed === true) { fill(0); } else { fill(255); } rect(25, 25, 50, 50); }

Most appropriate sub-area of p5.js?

  • Documentation

Feature enhancement details:

function draw() { if (keyIsPressed) { fill(0); } else { fill(255); } rect(25, 25, 50, 50); }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions