# Display typed responses

**URL:** <https://discourse.psychopy.org/t/display-typed-responses/31849>\
**Category:** Coding\
**Created:** [November 10, 2022, 1:12am UTC](https://discourse.psychopy.org/t/display-typed-responses/31849 "2022-11-10T01:12:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![VM\_2157](https://avatars.discourse-cdn.com/v4/letter/v/e99b99/32.png) [@VM\_2157](https://discourse.psychopy.org/u/VM_2157)\
**Post date:** [November 10, 2022, 1:12am UTC](https://discourse.psychopy.org/t/display-typed-responses/31849/1 "2022-11-10T01:12:41Z")

</div>

Hello,

I found solutions how to display typed responses using Builder, but I have trouble finding functions to do that in Coder…  
While presenting a question something like this,

```auto
instructionStr = "Type answer here"
instText = visual.TextStim(myWin, text=instructionStr, pos=(0,0), color=(-1,-1,-1), height=0.1)

```

I want to display typed keyboard responses (word) on the same screen.  
What function of PsychoPy in Coder can accomplish it?

Thank you.

---

<div class="post-metadata">

**Author:** ![jonathan.kominsky](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jonathan.kominsky](https://discourse.psychopy.org/u/jonathan.kominsky)\
**Post date:** [November 11, 2022, 8:14am UTC](https://discourse.psychopy.org/t/display-typed-responses/31849/2 "2022-11-11T08:14:34Z")

</div>

Here’s a very simple one:

```auto
typedText = ''
textEntryCompleted = False
showText = visual.TextStim(myWin, text=typedText, pos=(0,-.5), color=(-1,-1,-1), height=0.1)
while not textEntryCompleted:
    keyPressed = event.waitKeys()
    if 'return' in keyPressed:
        textEntryCompleted = True
    elif 'space' in keyPressed:
        typedText = typedText + ' '
    else:
        typedText = typedText + keyPressed[-1]
   
    showText.text = typedText
    showText.draw()
    myWin.flip()

```

This doesn’t work with uppercase/lowercase stuff, but that is also possible using the ‘modifiers=True’ argument in event.waitKeys() and the Python string function .upper(), but the logic is a little more complicated.
