Code to detect single or double click

but you shouldn't report a single click first