input: dt2w: refactored code of commit about 'improve accuracy of single touch detection'