handle touch and mouse events differtly