How to store reaction time data for each key press using textbox component

OS: MacOS Big Sur 11.1
PsychoPy version (e.g. 1.84.x): 2020.2.1
Standard Standalone? (y/n): Yes
What are you trying to achieve?: I am trying to create an experiment in which participants see a word on the screen which they then have to type. I need them to be able to see what they’re typing but I also want to record reaction times for each key press and store which keys were pressed, including backspace. Once participants have finished typing the word, I want the ‘return’ key to end the routine.

What did you try to make it work?: I have tried adding both keyboard and textbox components, with the textbox component reading from an .xcl file to show the words to participants that they must type. The keyboard component does not force the end of the routine, all keys are allowed (i.e. none specified in this box) and all keys are stored. I added this component hoping it would get and store reaction time data for each key press. To end the routine I have added a code component to every frame as follows:

if len(Keyboard.keys) > 0:
    if Keyboard.keys[len(Keyboard.keys)-1] == 'return':
        continueRoutine = False

What specifically went wrong when you tried that?:
When I run the experiment just a blank grey background screen is shown and none of the words are displayed. When I just have the textbox component, the words are displayed correctly, so my thinking is there is some kind of issue with the interaction between the textbox and keyboard/code components, but I just can’t figure out what’s wrong!

Any help would be hugely appreciated.