Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Record response_time when Mouse is being moved not clicked

Hi everyone,

I'm creating an experiment in which geometrical forms will be presented on different pictures with different location. The subject task will be to press a key on the keyboard when a square is presented and to click on the target when a circle is presented

For the mouse condition, I want to record Time_response when the target is being clicked but also when the mouse is being moved (when the motor program is being initiated) so the response-time won't be dependant of the distance between mouse and target.

So, I set the Mouse pos :

souris = Mouse()

souris.set_pos(pos=(0,0))

I want to get the time response when the pos becomes different from(0,0)

I hope I'm clear..


Thank u for responses !

Best Regards

Comments

  • edited March 26

    Hi,

    if you use the mousetrap_response item to collect the mouse response, you can use it to reset the mouse to the specified position. It also automatically computes the initiation_time variable, which is the time until any movement was initiated (which is I think the time you are interested in).

    Best,

    Pascal

  • Hi Pascal,

    Thank u for your quick answer

    I don't have mousetrap and I decided to install it.

    I followed the instructions and I wrote in the debug window :

    import pip

    pip.main(['install', 'https://github.com/PascalKieslich/mousetrap-os/archive/master.zip'])


    But I can't install it because of my old version of pip I guess :

    You are using pip version 9.0.1, however version 19.0.3 is available.

    You should consider upgrading via the 'python -m pip install --upgrade pip' command.


    But when I tap the command : python -m pip install --upgrade pip

    I have this message : NameError: name 'python' is not defined

    What should I do ?

    Thank u

  • How can I upgrade my pip from OpenSesame ?

  • The message you are posting is not an error but a warning, because OpenSesame is using an old version of pip. If you have run the commands specified above, you simply need to restart OpenSesame and the mousetrap items should be present. If not, could you post the complete message you get after running the commands?

  • import pip

    pip.main(['install', 'https://github.com/PascalKieslich/mousetrap-os/archive/master.zip'])


    Collecting https://github.com/PascalKieslich/mousetrap-os/archive/master.zip

      Downloading https://github.com/PascalKieslich/mousetrap-os/archive/master.zip

    Exception:

    Traceback (most recent call last):

     File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pip\basecommand.py", line 215, in main

      status = self.run(options, args)

     File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pip\commands\install.py", line 335, in run

      wb.build(autobuilding=True)

     File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pip\wheel.py", line 749, in build

      self.requirement_set.prepare_files(self.finder)

     File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files

      ignore_dependencies=self.ignore_dependencies))

     File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pip\req\req_set.py", line 634, in _prepare_file

      abstract_dist.prep_for_dist()

     File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pip\req\req_set.py", line 129, in prep_for_dist

      self.req_to_install.run_egg_info()

     File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pip\req\req_install.py", line 439, in run_egg_info

      command_desc='python setup.py egg_info')

     File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pip\utils\__init__.py", line 676, in call_subprocess

      line = console_to_str(proc.stdout.readline())

     File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pip\compat\__init__.py", line 73, in console_to_str

      return s.decode(sys.__stdout__.encoding)

    AttributeError: 'NoneType' object has no attribute 'encoding'

    You are using pip version 9.0.1, however version 19.0.3 is available.

    You should consider upgrading via the 'python -m pip install --upgrade pip' command.

  • Hmm this is weird.

    I just checked the installation procedure using OpenSesame 3.2.7 under Windows 7 and Windows 10 and it worked for me.

    I run OpenSesame as an administrator and then paste the following two lines in the debug window

    import pip
    pip.main(['install', 'https://github.com/PascalKieslich/mousetrap-os/archive/master.zip'])
    

    The resulting message is:

    Collecting https://github.com/PascalKieslich/mousetrap-os/archive/master.zip
     Downloading https://github.com/PascalKieslich/mousetrap-os/archive/master.zip
    Installing collected packages: opensesame-plugin-mousetrap
     Running setup.py install for opensesame-plugin-mousetrap: started
      Running setup.py install for opensesame-plugin-mousetrap: finished with status 'done'
    Successfully installed opensesame-plugin-mousetrap-1.3.0
    You are using pip version 9.0.1, however version 19.0.3 is available.
    You should consider upgrading via the 'python -m pip install --upgrade pip' command.
    Out[1]: 0
    

    Which version of OpenSesame and which operating system are you using?

  • Indeed it's weird..

    I'm using Opensesame 3.2.7 (python 3.6.4) as well and my Os is windows 10 64bits. I already tried to reinstall OpenSesame but it still doesn't work.

  • Update !

    I installed the 32 bits version and.. It works !

    Don't know why

    Thank u for your help,

    I'll come back to you if I have questions about the use of mousetrack

    Best regards !

Sign In or Register to comment.