New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
keyPressed event: upper and lower case #536
Comments
it has to do with differences between browsers... we are updating the keyCode and key on keyPressed, keyReleased, and keyTyped which actually returns different results. this page explains a little more: however, this may need to be revisited, I don't know if the discrepancies are still there with the most recent browser versions, or maybe there is something smarter we can do, keeping track of some internal vars and only using the results from the keyup call if the key isn't already set... or maybe key and keyCode just shouldn't be updated at all on keyup? feel free to play around, it's all in src/input/keyboard, or I'll take a closer look next chance I get. |
Hi! There you'll be able to see that the p5's "keyTyped" event behaves the same as the native event "keypress", and the p5's "keyPressed" event behaves as "keydown" native event. So, I believe that the behaviour noticed by @shiffman is the normal one :) |
I would like to work on this fix. I had already submitted the patch for a similar issue in PDE -> processing/processing#4006 |
as @ipeluffo mentions, the behavior noticed is correct. the keypress event in browser events is mapped to |
e |
I'm noticing that in
keyPressed()
I always get a capital letter for any key pressed. For example with both 'a' and 'A' I get the following:With native browser events, however
I get:
and
Is this on purpose for a reason I'm missing?
The text was updated successfully, but these errors were encountered: