Update MouseHandler, make logic more clear.

Mouse will be updated only when its state has changed.