Press space for the pencil to follow you. To draw right after you press space press the w key.
really simple coding.