Error on Saving File, if the string has chars sourced from the key variable

Hi. I think This is related to this , a topic from @Eeyorelife I tried to answer.
But when I write “println(s.length());” within mousePressed() I just get a string length of 1. I was expecting two characters because when I hit a backspace the letter will appear.