automatic penup detection