Detect typen string after Return

So i want to make a textfield(i can do it myself), but i want to be able to detect what we had typen after enter had been pressed. For example:

  1. Player types in GoldBlock
  2. Presses Enter
  3. A boolean will be activated

So its kinda for a building game, and i need the textfield to choose blocks so i could build