Fix pointer events

@dfilatov @veged do you want to review changes :)

closes #545