Single and long clicks are now handled

Managed to do this without spinning off a separate thread. Should
be easy to add double clicks as well.