I have noticed an odd behavior when using P2D. The variable keyPressed is stuck on True after making a specific key combination with a letter and Shift or CTRL. If I do the following:
- Press and hold a letter key
- Press and hold Shift (while still holding letter)
- Release letter (while still holding Shift)
- Release Shift
keyPressed is now true with no keys pressed. Pressing the same letter key again seems to reset it. So if you did a+Shift, press and release a again to set keyPressed back to false. You can try to reproduce it with this sketch:
color black = color(36,39,45);
color green = color(141,187,110);
void setup(){
size(1600,900,P2D);
}
void draw(){
if (keyPressed){
background(green);
} else{
background(black);
}
}
This does not happen with the default renderer. It’s an oddly specific combination, so I am not sure what’s going on here.