xxxxxxxxxx
16
function setup() {
createCanvas(400, 400);
fill(0, 200, 0);
console.log("to see keyboard must click on canvas first!\n use [ctrl][z] RED \n key [c] GREEN");
}
function draw() {
background(200, 200, 0);
circle(width / 2, height / 2, 30);
}
function keyPressed() {
console.log("key " + key + " keyCode " + keyCode);
if (keyIsDown(CONTROL) && key == 'z') fill(200, 0, 0);
if (key == 'c') fill(0, 200, 0);
}