Custom events?

So I’m looking for an analytic package for my site and very impress with Piwik. I have a few questions about the product (played with the demo but havent’ installed it yet). Can I create custom events, can i send events via PHP?

For instance one of my sites allow someone to download a random file. They click on the link and you get a download dialog. I know the file on the server side and would like to be able to push that to Piwik. Client side would only see a download dialog.

Can Piwik do anything like this?

“How does Piwik track downloads?”