Are you aware of the properties panel tab called events.
I suggest you have a look and do help on some that might be interesting.
Better learning than just getting the answer.