Getting this error when running my experiment online. I think it’s related to the textbox component. I’m wondering whether the issue has been resolved on PsychoPy’s end and if not what can be the workaround for this ?
I guess I’ll just have to wait for the new release then. Before that, code seems to be the only way. The TextInput experiment I tried, the backspace and space key only work once, and after that ‘backspace’ and ‘space’ would come up and there’s no way to change, did you have a solution for that?
Anyone know when the new version will be released? I can’t recruit until January anyway…so I’ll prob wait.
Just in case the wait is too long, @wakecarter can you share your code solution to getting the input textbox to work on Pavlovia? Is it a code-insert workaround? Thanks!
The linked experiment was only changed on the line that the error pointed to, AutoDraw, I changed it from true to false. Even though the error disappeared, the textbox is now unresponsive.
I have decided to use code for editable text and thus removed the textbox component as it was faulty in some way…and have since initiated a new repo for this new version.
Thanks for looking into my issue!
if cursorCounter >= 30:
if cursorVariable=='_':
cursorVariable=' '
else:
cursorVariable='_'
cursorCounter=0
cursorCounter+=1
keys = event.getKeys()
if len(keys):
#Start the clock on first key
if textStarted == 0:
textStarted = 1
rt0=myClock.getTime()
myClock.reset()
if 'return' in keys and len(displayText)>1:
rt1=myClock.getTime()
continueRoutine=False
elif 'space' in keys:
displayText+=' '
elif 'period' in keys:
displayText+='.'
elif 'comma' in keys:
displayText+=','
elif 'apostrophe' in keys:
displayText+='\''
elif 'minus' in keys:
displayText+='\-'
elif 'backspace' in keys:
displayText=displayText[:-1]
elif 'lshift' in keys or 'rshift' in keys:
modify = True
elif len(keys[0])>1:
pass
elif modify==False:
displayText += keys[0]
End Routine
thisExp.addData("typedWords", displayText)
thisExp.addData("thinkingTime", rt0)
thisExp.addData("typingTime", rt1)
text_feedback.text='Thinking time = '+str(round(rt0,2))+'s\nTyping time = '+str(round(rt1,2))+'s\n'+displayText
Hi @wakecarter, I have similar code and my editable text works good locally, but when running online, the screen always preserves the last key press, in other words, it’s not empty where participants are supposed to type into. Did you experience the same issue?
I have similar problem but I’ve accidently realized something:
I’ve created a new experiment in order to understand the textbox component. If I add the “Array.prototype.append = .push;” code at my experiment. I get “TypeError: state.toLowerCase is not a function” if I remove it, experiment works perfectly.
I’ve have also demonstrated it with below video:
What I need is to use both features (textbox and Array.prototype.append = .push). Can anyone help about this issue?
As per my crib sheet I have myClock = core.Clock() on the Python side and myClock = new util.Clock(); on the JS side in Begin Experiment in a Both code component in the start routine.