Moved mouse capture handling into the server.