Click on the canvas to get its focus

Then press the "D" key to lengthen the line

And press the "A" key to shorten the line