processing / processing/p5.js-web-editor
keyTyped does not work in conjunction with returning false in mousePressed
Open
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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