Arduino/Processing/Webcam

OK, I'm very new to the whole world of arduino, processing and coding in general.

What I'm trying to do...
Take a photo from a webcam when a physical button is pressed (arduino).

What I've got so far...
I've managed to piece together a few different bits of code in processing to enable a photo to be taken when the mouse button is pressed.

My problem...
How do I link arduino and processing to replace the mouse button with a physical button?

End aim...
If could get arduino and processing working together, I hope to replace the button with different sensors to activate the camera when someone is near to it.

Any suggestions or advice would be very gratefully received.

This is the processing code I have so far.

http://www.chrismcnicholl.com/processing-and-webcam-code

How do I link arduino and processing to replace the mouse button with a physical button?

Using serial data. When the Arduino detects that a switch is pressed, the Arduino sends a message to the serial port. The Processing application monitors the serial port, and reads the serial data, parses the data, and takes appropriate action.