added keyPressed() function to pde file