**OS: macOS Catalina 10.15.4
**PsychoPy version: 2020.1.2
**Standard Standalone: YES
What are you trying to achieve?:
Get a list of keys pressed for a specific Keyboard component in an online experiment created in the builder of Psychopy.
What did you try to make it work?:
I have a keyboard component which is set to allow only two keys. Additionally, I have a code component which is set to check the number of keys pressed every frame. The code works well when running the experiment locally in Python. The following minimal code gets a list of the pressed keys (which always has one element because the keyboard component was set to store only the last key pressed), and store its length in a new variable.
numKeysPressed = len(myKeyboard.keys)
numKeysPressed = myKeyboard.keys.length;
Every time I make a change now and compile the while script, these two attributes are set automatically to undefined. It would be great if by default these attributes are set automatically as empty lists. It is a hassle to modify every single time these values whenever something is changed in the experiment and the script is compiled.
Can I somehow change how this attributes are defined automatically every time the script is compiled?