Hi all,
I am working on an experiment where participants need to type responses to a stimulus in capital letters. I am using the most recent version of Psychopy. With the current code that I have, I am able to have capitalization using capslock, but you have to press capslock for every individual letter- it is behaving like a shift key. This is the code I have right now:
keys = event.getKeys()
if len(keys):
if 'space' in keys:
text.text = text.text + ' '
elif 'backspace' in keys:
text.text = text.text[:-1]
elif 'lshift' in keys or 'rshift' in keys:
modify = True
elif 'capslock' in keys:
modify = True
elif 'return' in keys:
continueRoutine = False
else:
if modify:
text.text = text.text + keys[0].upper()
modify = False
else:
text.text = text.text + keys[0]
I need the capslock key to work for all letters when pressed once. Thank you!