v0.5: mouse handler improvement