Set event type on enter/leave events

Fixes #444.
Merge pull request #772 from spicyj/gh-444

Set event type on enter/leave events