Implement cursor movement.