I would like to know how to change the effects of mousePressed in my program. It's a simple program where when mouse is pressed it draws a random fuzzy grouping of lines. (think of the old doodle boards). I would like to be able to change this to a single line when a key is pressed and then back if another is pressed.....? Any Ideas? Also I am would like to make it so you can cycle through the background images, not just random. see code below to see how it works so far and thank you in advance.
int grow = 0;
void setup()
{
size(600,600);
PImage fragment;
float a= random(1,6);
int fragNumber = int (a);
fragment = loadImage ("img_" + fragNumber + ".jpg");
image(fragment, 0, 0, 600, 600);
}