<Paramname="Each Frame"updates="constant"val="n= len(theseKeys)&#10;i = 0&#10;while i < n:&#10;&#10; if theseKeys[i] == 'return' and len(inputText) >1:&#10; # pressing RETURN means time to stop&#10; continueRoutine = False&#10; break&#10;&#10; elif theseKeys[i] == 'backspace':&#10; inputText = inputText[:-1] # lose the final character&#10; i = i + 1&#10;&#10; elif theseKeys[i] == 'space':&#10; inputText += ' '&#10; i = i + 1&#10;&#10; elif theseKeys[i] in ['lshift', 'rshift']:&#10; shift_flag = True&#10; i = i + 1&#10;&#10; else:&#10; if len(theseKeys[i]) == 1:&#10; # we only have 1 char so should be a normal key, &#10; # otherwise it might be 'ctrl' or similar so ignore it&#10; if shift_flag:&#10; inputText += chr( ord(theseKeys[i]) - ord(' '))&#10; shift_flag = False&#10; else:&#10; inputText += theseKeys[i]&#10;&#10; i = i + 1&#10;"valType="extendedCode"/>