OS (e.g. Win10): MacOS
PsychoPy version (e.g. 1.84.x): 1.85.4
Standard Standalone? (y/n) Yes
What are you trying to achieve?: Update and display keyboard input in textBox
What did you try to make it work?:
I was having the same problem occurring in the link below (psychopy crashing with keyboard input):
https://groups.google.com/forum/#!topic/psychopy-users/WsDp_w485w4
The comments on the thread above wrote that textBox is more stable than textStim, so I was trying to
use textBox in the code component within the builder.
However, I couldn’t find a way how to update keyboard input using textBox.
I did create a textbox using the code below in the begin experiment section:
textbox=visual.TextBox(window=win,
text = ‘default text’,
font_size =30,
font_color=[-1,-1,1],
size=(2,1.5),
pos=(-0.5,0.0),
grid_horz_justification=‘center’,
units=‘norm’)
I also created the objects below in the begin experiment section:
word = “Type what you heard”
inputText = “” -> this is the object that changes with every keyboard input
However, when I added the line below in the each frame section
textbox.setText(word + ‘\n’ + inputText)
I got an error message.
What specifically went wrong when you tried that?:
Below is the error message:
textbox.setText((word + ‘\n’ + inputText))
TypeError: ‘str’ object is not callable
Exception RuntimeError: RuntimeError(‘sys.meta_path must be a list of import hooks’,) in <bound method ExperimentHandler.del of <psychopy.data.experiment.ExperimentHandler object at 0x1107eaed0>> ignored
Has anyone succeeded in updating keyboard input and showing that in the textBox?