working single, double, and long press detection