Moved mouse input processing to MouseDevice.