Skip to content
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 #1013

Merged
merged 3 commits into from Oct 19, 2015
Merged

keyPressed event: upper and lower case #536 #1013

merged 3 commits into from Oct 19, 2015

Conversation

iamutkarshtiwari
Copy link
Contributor

This patch is a fix to the issues -> #536

With this patch, the 'keyPressed()' function will display all the letters(both upper & lower case) with their respective keyCodes(both 65-90 & 97-122) depending the On/Off status of CapLock and Shift keys. :)

@lmccart lmccart merged commit 9840ec1 into processing:master Oct 19, 2015
@lmccart
Copy link
Member

lmccart commented Oct 19, 2015

thanks!

@lmccart
Copy link
Member

lmccart commented Oct 19, 2015

I'm sorry, I had to revert this PR as it was causing the key to be undefined inside keyPressed(). would you like to take another look and resubmit with an updated patch? thanks!

@iamutkarshtiwari
Copy link
Contributor Author

@lmccart Could you please elaborate the problem which you are facing with this patch so that I can re-modify it ? A screenshot would be helpful. :)

@iamutkarshtiwari
Copy link
Contributor Author

@lmccart I re-tested the above PR but couldn't find the problem you mentioned. Could you please share the code you tested it with?

@lmccart
Copy link
Member

lmccart commented Oct 29, 2015

@iamutkarshtiwari sorry for the delay on this, I will post tomorrow!

@lmccart
Copy link
Member

lmccart commented Oct 31, 2015

hi @iamutkarshtiwari, apologies again for the delay...
here's the example code I'm testing with:

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

function keyPressed() {
  console.log('keyPressed key:'+key+' keyCod:'+keyCode);
}

function keyTyped() {
  console.log('keyTyped key:'+key+' keyCod:'+keyCode);
}

function keyReleased() {
  console.log('keyReleased key:'+key+' keyCod:'+keyCode);
}

when I use the keyboard.js file from this PR, this is the output in the console:
screen shot 2015-10-31 at 2 51 23 pm

in comparison, when I use the current keyboard.js file in the p5.js repo, I see this output:
screen shot 2015-10-31 at 2 51 58 pm

so it seems that inside keyPressed(), the key is not assigned yet, which I imagine would be a point of confusion as a lot of people create sketches based on testing the key inside keyPressed().

@iamutkarshtiwari
Copy link
Contributor Author

There seems to be some problem with chrome because when I tested this patch on firefox, it worked perfectly fine. Looking into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants