Windows 10, Version 2020.2.4, Standalone
Hi, I’m building an experiment where participants read a series of sentences then recall the last words of each sentence. The recalled words are separated by space, and participants should be able to modify their answer if needed. Here’s my code
if("backspace" in key_resp_5.keys):
key_resp_5.keys.remove("backspace")
if(len(key_resp_5.keys) > 0):
key_resp_5.keys.pop()
elif("space" in key_resp_5.keys):
key_resp_5.keys.remove("space")
key_resp_5.keys.append(' ')
elif("return" in key_resp_5.keys):
key_resp_5.keys.remove("return") #remove return
if(len(key_resp_5.keys) > 0):
screen_text = ''.join(key_resp_5.keys)
thisExp.addData("simple_recall", screen_text) #store response in data file after entering
continueRoutine = False
The problem I have is that Backspace and Space only work once. For example, if somebody typed “red”, one press of backspace works fine “re”, another press the on screen text becomes “red” again, one further press makes it “redbackspace”. Same patterns goes with “space” key as well. I’m wondering how to fix this. I did refer to TextInput experiment, but still unable to figure this out.