You just need to save the list of characters to be written, and always print the next one from the list, no matter which key was pressed by the player. It's not an actual input field.