We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello there,
I'm triggering animations that should change based on different keys pressed. I'm having no issues triggering events based on single key presses. I'm however not able to make something happen if two keys are pressed simultaneously.
I want to do something like this:
void keyPressed() {
if(key == 'a' & key == 'b') {
// do stuff
}
}
This is obviously wrong. I've been searching for how to do this on the forum and found some information about how to parse the raw data coming in over serial. Can anyone guide me on how to do this?
Also, I'm testing my program with the built-in keyboard on my Mac but will deploy this using a custom Teensy USB external keyboard with Arcade Buttons attached. Will the code work interchangeably for either keyboard?
Answers
You can do **this : **
beware that some keyboards won't register multiple keys beyond a certain number - people have had trouble doing two-player, shared-keyboard games in the past.
Thank you!