Be more discriminating when handling touch events

Check the position and type of the touch event to determine
whether acceleration is being applied.

The only issue with this is that if a touch moves from the right
of the screen to the left, if a touchend event occurs in the left
side of the screen, it won't stop the acceleration. But it's a
better solution than counting the number of touches.