psychopy.org | Reference | Downloads | Github

mouse.isPressedIn()


#1

How to translate this python code:

if mouse_2.isPressedIn(go):
   continueRoutine = False 

into javascript?

I upload an example program to pavlovia https://gitlab.pavlovia.org/succiWang/test . really need your help,thanks!


How to realize "continueRoutine = False" online
#2

The syntax of a loop is just slightly different in Js than in Python:

if (mouse_2.isPressedIn(go)) {  // Add parentheses and a curly brace {
      continueRoutine = false;  // Add a semicolon and make "false" lowercase
    }  // Add a curly brace }

#4

Thanks for your sincere help . I tried this syntax before , however, the experiment couldn’t run successfully , it alerted me that " mouse .is PressedIn() " is an invalid syntax online. :anguished: