Problem with GIO

Hi all, I’m facing a problem, I can’t find what I think is reliable information on the library. I need the result of user input via material.Editor to be saved to a variable when the user presses enter, but even the official GIO site uses input.Source, which doesn’t seem to be used anymore. How can I save the result to a variable when I press a key? And one more question: when clicking on the input window, how can I make it so that the information is transmitted ONLY after pressing enter, and not all the time while the input window is pressed?