Sol,
of course I can. I hope these are the parts you want to see.
I added comments.
Also:
this code runs in multiple locations and it is only in one that the problem occurred. Unfortunately, the person there is much less of a programmer than I am ( and I am not a programmer ). So, all I get is the verbal description ( including the “moved mouse into” )
Thanks in advance
Reiner
(sorry for the length)
Early initialization:
GetMailString = visual.TextBox2(
win, text=None, font='Arial',
pos=(0, -0.1), letterHeight=0.04,
size=(1,.1), borderWidth=2.0,
color='black', colorSpace='rgb',
Now inside the actual Program:
------Prepare to start Routine “Get_E_Mail”-------
continueRoutine = True
routineTimer.add(60) # timeout for e-mail
update component parameters for each repeat
mailstring =""
#needs to be intialized, otherwise contains all previous key-strokes
GetMailString.text =""
keep track of which components have finished
Get_E_MailComponents = [EMailBackground, GetMailString]
“”" more PsychoPy Code “”"
-------Run Routine “Get_E_Mail”-------
#-- My_get_Contact is based on earlier decision,
#-- My-Abandon just detected wether people left the unattended experiment
while continueRoutine and My_get_Contact == 1 and My_Abandon == False and routineTimer.getTime() > 0:
# get current time
t = Get_E_MailClock.getTime()
tThisFlip = win.getFutureFlipTime(clock=Get_E_MailClock)
tThisFlipGlobal = win.getFutureFlipTime(clock=None)
frameN = frameN + 1 # number of completed frames (so 0 is the first frame)
# update/draw components on each frame
# The Background image: *EMailBackground* updates
if EMailBackground.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance:
# keep track of start time/frame for later
EMailBackground.frameNStart = frameN # exact frame index
EMailBackground.tStart = t # local t and not account for scr refresh
EMailBackground.tStartRefresh = tThisFlipGlobal # on global time
win.timeOnFlip(EMailBackground, 'tStartRefresh') # time at next scr refresh
EMailBackground.setAutoDraw(True)
#GetMailString is using the textBox2 as seen in the initialization above
# *GetMailString* updates
if GetMailString.status == NOT_STARTED and tThisFlip >= 0.0-frameTolerance:
# keep track of start time/frame for later
GetMailString.frameNStart = frameN # exact frame index
GetMailString.tStart = t # local t and not account for scr refresh
GetMailString.tStartRefresh = tThisFlipGlobal # on global time
win.timeOnFlip(GetMailString, 'tStartRefresh') # time at next scr refresh
GetMailString.setAutoDraw(True)
mailstring = GetMailString.text
# CDO mailstring
final_mail =""
if mailstring.find("\n") > -1:
final_mail = mailstring.rstrip("\n")
continueRoutine = False