I am sure you can do it with an invisible text box, but the text box has to be on screen and set invisible via CSS.
Just set textbox.text and Sprite font.text to something like this left(TextBox.Text,100) will limit it to 100 characters.
For touch input I created my own keyboard, was more reliable than textbox, one sprite object with all images of all keys, each has its own instance variable that matches the array holding the alphabet, so when you press a key, or actually touch sprite with instance var of 0, it will add letter A to your Sprite font text. because position 0 in the array holds a value of "A"