Using win.flip() and waitkeys on pavlovia

Hello. I am trying to make this code work online but it seems to be skipping over the entire code component. I kept getting issues using win.flip and event.waitkeys, so I commented them out. I am trying to draw the images based on a condition and then advance if any button is pressed. What’s the best way to do this so it works online?


# draw slide based on condition
if instruction_slide_2_selection == 1:
    
    fractal_blossom.pos = [-.12, .13]
    fractal_octopus.pos = [.12, .13]
    
    instructions_slide_two.setAutoDraw(True)
    fractal_blossom.setAutoDraw(True)
    fractal_octopus.setAutoDraw(True)
    #win.flip()
    #event.waitKeys()
    
elif instruction_slide_2_selection == 2:
    
    fractal_blossom.pos = [.12, .13]
    fractal_octopus.pos = [-.12, .13]
    
    instructions_slide_two.setAutoDraw(True)
    fractal_blossom.setAutoDraw(True)
    fractal_octopus.setAutoDraw(True)
    #win.flip()
    #event.waitKeys()

kb.clearEvents() # clear keyboard events

instructions_slide_two_second.setAutoDraw(True)
#win.flip()
#event.waitKeys()

kb.clearEvents() # clear keyboard events
1 Like

Hi Ben,

Did you find a solution to this? I am having a similar problem where event.waitkeys in Psychopy doesn’t auto-convert to JS for Pavlovia. Currently trying to find a workaround but if you have found one please let me know!

Hannah

You shouldn’t use wait keys in Builder.

Instead use a keyboard component or getKeys each frame.

1 Like