

ThisExp.addData('inputText_test1', inputText_test1)Īgain, this solution is pretty crappy, but it worked for me InputText_test1 += unichr( ord(theseKeys) + ord('B') + ord('B'))Įnd routine: # store the response input for initial test InputText_test1 = inputText_test1 + u'\xf1' InputText_test1 = inputText_test1 # lose the final characterĮlif theseKeys in : #this is for the ñ character # pressing SPACE means time to stop, but only if a word is written If (theseKeys = 'space'and inputText_test1 != ""): The English keyboard doesn’t do this so we’re going to code it. On a Spanish keyboard, to add any accented word what we normally do is press the apostrophe key (“´”), and then the vowel. In the case of the Spanish keyboard, I needed the following characters: “á”, “é”, “í”, “ó”, “ú”, and “ñ”.

The English keyboard doesn’t have accents, so we have to create them. So even if your physical keyboard is in French (or Spanish in mi case), it will work like an English one. The first thing I did was change the keyboard setting to English. It’s not the best solution, but it worked for me. InputText += chr( ord(theseKeys) - ord(' ')) # otherwise it might be 'ctrl' or similar so ignore it # we only have 1 char so should be a normal key, InputText = inputText # lose the final characterĮlif theseKeys in :
Psychopy typing how to#
I really have no idea how to do this, so any help is welcomed. My experiment is in Spanish, so I need to fix this. This works perfectly, however, it does not support keys with accents (á, é, í, ó, ú). What are you trying to achieve?: I have added a code component to my experiment, where participants can type the answer at the same time it is displayed.
