boolean shiftPressed; String drawText = ""; void setup() { textFont(createFont("SansSerif", 16), 16); fill(0); frameRate(2); } void draw() { background(192); text(frameCount, 16, 16); text(drawText, 16, 32); } void keyPressed() { if (key == CODED && keyCode == SHIFT) shiftPressed = true; } void keyReleased() { shiftPressed = false; } void mousePressed() { drawText = shiftPressed ? "shift-click" : "click"; } void mouseReleased() { drawText = ""; }