Triggering Events

This is pseudo-code and is not meant to work -- it's just for the
concepts.