Maybe you can share some more infos...
Are you using the offical Raspberry Pi 7" Display - or do you use a different display / touch device?
Have you connected a keyboard / mouse device?
What outputs do you get on the terminal when you start the example?
What is the result when you entered the following line?
cat /proc/bus/input/devices