How to create custom events?

For the longer version of what @Tzk said, check this out: