pen_up/pen_down detection