Generic event handler processing, fixes #4
Marginally better pakkuman key handling (still faulty though)