Add listeners for character and line entry