PhET does not currently have a UI component for entering text (or numbers) directly from the keyboard. There have been several discussions about adding something like this, but (as far as I know) nothing is planned for the short term.
You might have a look at Keypad.js, which allows you to enter numbers using a numeric keypad. It lives in the scenery-phet repository, with a demo in ComponentsView.js. There's a good example of using Keypad in the Unit Rates simulation, see KeypadPanel.js in the unit-rates repository.
Chris Malley
PixelZoom, Inc.