Hi @alba, a simple solution involves using text and code components in Builder. Have one component display text called e.g., displayText
, and another called e.g., copyText
In the code component, add the following code to the relevant tabs. Note, the shift keys to capitalize are not working at this point.
Begin Experiment
import string
allLetters = list(string.ascii_lowercase)
Begin Routine
textFill = ''
Each Frame
keys = event.getKeys()
if 'escape' in keys:
core.quit() # So you can quit
else:
if keys:
if keys[0] == 'space':
textFill += ' ' # Adds a space instead of 'space'
elif keys[0] == 'backspace':
textFill = textFill[:-1] # Deletes
elif keys[0] in allLetters:
textFill+=keys[0] # Adds character to text if in alphabet.
copyText.setText(textFill) # Set new text on screen