Implement single and double clicking