lineTo Object?

Hey guys, how would u make it so that on a keyPress it makes a line to a specified object?