could some one please help me i'm not sure if what i'm trying to do is possible, but i have created a rubiks cube consisting of 9 rows of 3 blocks, i have targeted each row with a colour when inputing a key press however once pressed a certain corresponding key, the colour changes when another key has been pushed. Is it possible that if i push a key the colour will appear and when i push another key this colour will remain and a new colour will appear on another row of blocks. i have included my code please could someone be able to explain to me if what i want to do is do able as I'm stuck.
thanks.
void setup(){
size(1000,800,P3D);
frameRate(30);
}
void draw(){
background(0);
lights();
String s = "Input one of the following on your keyboard: A B C D E F G H I";
fill(255);
text(s,10,10,100,100); // Text wraps within text box
float xpos = -110;
float ypos = 0;
float zpos =0;
translate(width/2,height/2,0);
rotateY(radians(mouseX));
rotateX(radians(mouseY));
for(int i= 0; i < 3; i++){
//do whatever is in here 3 times
pushMatrix();
fill(255);
translate(xpos,ypos, 0);
if (keyPressed == true) {
fill(3,0,252);//blue
xpos = 210;
ypos = 260;
zpos = 89;
box(150);
} else {
fill(255);
}
if (key == 'a' || key == 'A') { //target the key with a specific letter