processing / processing/p5.js-web-editor

keyTyped does not work in conjunction with returning false in mousePressed

Open
#3,139 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug
Dominant language
JavaScript
Stars
1.7k
Forks
1.7k
Avg merge
3d 4h
Merged PRs (30d)
8

Description

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);
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the provided sketch in Chrome on Windows, using mousePressed() that returns false and keyPressed() that prints key. Trace the editor's mouse and keyboard event handling, then verify that keyboard input still reaches keyPressed() after the mouse handler returns false.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.