Applied patch by Tomaz Solc to add cursor key panning. Minor cleanup of