Fix mouse input bugs and add double click.