detect touch event type and direction.