hmm...
Ok quick run through of theoretical approach to this.
1. create the keyEvent handler code.
2. on keyEvent key (release) add character to a variable or value.
3. when press enter (return), strip string & query if action exists for scene.
3b. if exists then start action linked to current scene (inside of this you will add your if queries & actions etc) action will be a
called by other action action.
3c. if action doesn't exist or queries inside of action are not met then display an error message.
4. clear current text on enter or after x time if error message was just displayed.
Still a lot of work though!
Also quick note: on press enter, you should also query if string is empty or contains certain commands not related to normal commands. !help for instance.