Move pointer-touch selection into a function

Same functionality as before, just moved into a new function.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>