It is all explain in the manual, have a look at "event".