Added vertical range to pan

Vertical range accounts for whether or not there is a selected location
Fixed keyPressed()