Add event handling for Processing 2