void setup() { background(0); strokeWeight(5); } void draw() { stroke( 255 * int(key=='1') * int(mousePressed) + 200 * int(key=='2') * int(mousePressed) + 150 * int(key=='3') * int(mousePressed) + 100 * int(key=='4') * int(mousePressed)); point(mouseX, mouseY); }