Skip to content

keyTyped does not work in conjunction with returning false in mousePressed #3139

Open
@BenMaydan

Description

@BenMaydan

Most appropriate sub-area of p5.js?

  • Color
  • Core/Environment/Rendering
  • Data
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Other (specify if possible)

Details about the bug:

  • p5.js version:
  • Web browser and version: Chrome, version "80.0.3987.132"
  • Operating System: Windows 10 OS Version 1909
  • Steps to reproduce this: return false in mousePressed, and suddenly you can't access anything to do with the keyboard

print(key) does not print anything. Code is below

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

function draw() {
background(220);
}

function mousePressed() {
return false;
}

function keyPressed() {
print(key);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugError or unexpected behaviors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions