Modified mouse events handling.