Comments (2)
Hm, looks like some discussion needed here.
The keyPressed function is currently bound to the onkeydown event.
document.body.onkeydown=function(e){
pKeyPressed = true;
if (typeof keyPressed === 'function')
keyPressed(e);
}
but we are setting keyCode only on the keypress event.
document.body.onkeypress=function(e){
keyCode = e.keyCode;
if (typeof keyTyped === 'function')
keyTyped(e);
}
The bigger issue here is that keyCode only has the correct ASCII representation in onkeypress(Chrome 29.0.1547.57, Firefox 23.0.1). For now, this brightredchilli/processing-js@5fc0667 has a temporary fix, just setting the keyCode in two places. This will at least give some default values to work with.
from p5.js.
closing for now. also removing the keycode and key set in onkeypress, this relates to a different code than the keyup and down events which refer to the physical key.
we can look at this when we implement with cross browser support later:
http://unixpapa.com/js/key.html
from p5.js.
Related Issues (20)
- Animated gifs don't work from version 1.6.0 HOT 2
- blendMode not working when doing point() drawing in webgl
- Gifs don't play in version 1.6 HOT 2
- Incorrect rendering h265/HEVC video with alpha channel HOT 5
- Image .loadPixel() generating warning 'Multiple readback operations' HOT 3
- p5.dom createSelect() options enable() HOT 5
- p5.Graphics.saveGif()
- Gifs exported from `saveGif` in setup start with a black frame
- Add a way to read back pixels from p5.Framebuffer
- Verify that p5.Framebuffer settings work in all environments
- Deleting a 'Done. Downloading your gif!🌸' paragraph after a while HOT 6
- Gifs are not playing HOT 2
- Gif test case is flaky
- Improve WebGL2 line performance using drawArraysInstanced()
- Offensive auto-generated titles for sketches HOT 2
- problem creating global function 'createElement' HOT 4
- Make Graphics and Framebuffer update ortho cameras HOT 3
- max() crashes on long arrays HOT 18
- Why could not I use arrow functions in the main js? HOT 3
- Improve scaling specs when executing webgl's orbitControl() HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from p5.js.