![]() If you plan on programming your PsychoPy experiment (so not use the Builder interface), you technically do not need the entire “standalone” PsychoPy package installing the psychopy Python package would suffice and you could just write your experiments in your favorite editor (like Visual Studio Code). Whereas the Builder interface generates such code from your graphical experiment, in the Coder interface you’ll write your experiment using functionality from the psychopy package directly! If you look at this generated Python script closely, you’ll see that most of the code is based on functions and classes from the psychopy Python package. When using the Builder interace, you’ve seen that, “under the hood”, PsychoPy converts your Builder experiment to a Python script, which is then executed to run your experiment. This time, we will create a variant of the classical color-word Stroop task, the emotion-word Stroop task, in which participants are presented with images of emotional facial expressions in combination with words describing emotions that are congruent with the images (e.g., an angry expression with the word “angry”) or incongruent with the images (e.g., a happy exression with the word “angry”). Like in the previous Builder tutorial, we will explain the concepts by walking you through the process of programming a real experiment. It will be a somewhat more “dry” tutorial because we won’t actually create any stimuli or trials in this tutorial, because we’ll save that for the next tutorial. Unlike keypresses from the old event.Introduction to the PsychoPy Coder (tutorial) #Īt last, we’ll discuss the PsychoPy Coder! In this tutorial, we explain the basics of the Coder interface. KeyPress ( code, tDown, name = None ) ¶Ĭlass to store key presses, as returned by Keyboard.getKeys() Keypresses) before starting to monitor for new keypresses. Whether to clear the keyboard event buffer (and discard preceding If True then we won’t report any “incomplete” keypress but all NB, pygame doesn’t return timestamps (they are always 0) waitRelease: True or False If the keyList is None, all keys will beĬhecked and the key buffer will be cleared completely. Only keypresses from this set of keys will be removed from keyList None or Īllows the user to specify a set of keys to check for. Maximum number of seconds period and which keys to wait for.ĭefault is float(‘inf’) which simply waits forever. Same as ~.getKeys,īut halts everything (including drawing) while awaiting keyboard input. Start recording from this keyboard waitKeys ( maxWait = inf, keyList = None, waitRelease = True, clear = True ) ¶ Start recording from this keyboard stop ( ) ¶ Parametersīackend – ‘iohub’, ‘ptb’, ‘event’, or ‘’ Returns Keys will be presses will be returned, but only those with aĬorresponding release will contain a duration value (others willĬlear ( bool ( default True )) – If False then keep the keypresses for further calls (leave theĪ list of Keypress objects classmethod setBackend ( backend ) ¶ WaitRelease ( bool ( default True )) – If True then we won’t report any “incomplete” keypress but all ![]() KeyList ( list (or other iterable )) – The keys that you want to listen out for. getKeys ( keyList = None, waitRelease = True, clear = True ) ¶ Parameters WaitForStart ( bool ( default False )) – Normally we’ll start polling the Keyboard at all times but youĬould choose not to do that and start/stop manually instead by Or -1 for all devices acting as a unified KeyboardīufferSize ( int) – How many keys to store in the buffer (before dropping older ones) Or a dict containing the device info (as from getKeyboards()) The Keyboard class provides access to the Psychtoolbox KbQueue-basedĬalls on Python3 64-bit with fall-back to event.getKeys on legacyĬreate the device (default keyboard or select one) Parametersĭevice ( int or dict) – On Linux/Mac this can be a device index Keyboard ( device = -1, bufferSize = 10000, waitForStart = False, clock = None, backend = None ) ¶ ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |