add key_action

This commit is contained in:
2023-10-09 08:25:40 +02:00
parent f933a9f7fe
commit ee50fc0348
3 changed files with 62 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
boolean bg_is_white = true;
void draw() {
if(bg_is_white) {
background(255);
fill(0);
} else {
background(0);
fill(255);
}
ellipseMode(CENTER);
ellipse(50, 50, 50, 50);
}
void keyPressed() {
bg_is_white = false;
}
void mousePressed() {
bg_is_white = true;
}