Insert blank into textfield

I create a textfield and I want to make a script to press Space automatically when I press any button

For example : when I type abc, the text in textfield is a b c