touch input rewrite