Skip to content

keyPressed() only works once per key (for certain keys) in Chrome, keyReleased() not at all #3569

@rruubboott

Description

@rruubboott

Nature of issue?

  • Found a bug

Most appropriate sub-area of p5.js?

  • Events

Which platform were you using when you encountered this?

  • Desktop/Laptop

Details about the bug:

  • p5.js version:
    v0.7.3
  • Web browser and version:
    72.0.3626.119
  • Operating System:
    macOS mojave
  • Steps to reproduce this:

keyPressed() will fire once for any of the arrow keys, then never again. Many other keys (most letters, for instance) are fine - but some letters will only fire once (e,a,c - for example). This does not happen in editor.p5js.org nor on Opera. Just Chrome....

let counter = 0;

function setup() {
createCanvas(800,800);
}

function draw() {
// put drawing code here
}

function keyPressed(){
counter++;
console.log(counter);
}

Feature enhancement details:

New feature details:

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