Hello, I can’t find this question in the forum, let’s see if you can help me. I’m trying to create a condition when I press two keys at the same time, but it doesn’t work for me. Does anyone know if it’s a syntax issue or if it just can’t be done?
Another technique is to use a boolean array with two elements, each key setting its value true or false based on whether it’s pressed or not. That means you’ll have to add a keyReleased() method. Then in draw() something like this:
if ((keyDwn[0])&&(keyDwn[1])) {
wei=0;
} else {
wei+=0.1;
}
That should arrest growth of the rectangle if that’s the goal.