Cours:ProcessingClavierCorrige
void draw()
{
if (keyPressed == true)
{
if (key == 'd' || key == 'D')
{
fill(0);
rect(0,0,50,100);
fill(255);
rect(50,0,50,100);
}
else if (key == 'g' || key == 'G')
{
fill(255);
rect(0,0,50,100);
fill(0);
rect(50,0,50,100);
}
}
}