How can I disable Mouse Input in PTB-3 Windows 10

Dear all,

Is there any command for the Psychtoolbox to disable mouse input for certain periods, such as:


Code.....
....

disableMouse();
more code...
...
enableMouse();

further code...


This would be awesome to have and I think it should be a basic functionality of any psychophysics toolbox.

The only similar command I found is for GetClicks with the option InterClickSecs, which, as far as I understand, only allows me to skip mouse input for a predefined interval. However, I need to disable and enable it flexibly.

Many thanks in advance,
David


I dont understand your question. If you don't want mouse input, then simply don't call getClicks? Or ignore its output? do you maybe mean you dont want to see the mouse? Use HideCursor()

On Fri, Feb 3, 2017 at 3:19 PM, zufkq6al63qznouesypsepd674lfkre2x4e4dw6h@... [PSYCHTOOLBOX] <PSYCHTOOLBOX@yahoogroups.com> wrote:


Dear all,

Is there any command for the Psychtoolbox to disable mouse input for certain periods, such as:


Code.....
....

disableMouse();
more code...
...
enableMouse();

further code...


This would be awesome to have and I think it should be a basic functionality of any psychophysics toolbox.

The only similar command I found is for GetClicks with the option InterClickSecs, which, as far as I understand, only allows me to skip mouse input for a predefined interval. However, I need to disable and enable it flexibly.

Many thanks in advance,
David





My problem is the following:

Four subjects simultaneously play a game on four PCs that are linked via LAN. I wrote a subroutine, which at certain points in the experiment makes the PCs wait until all other three PCs have reached the same point in the experiment. During this period, subjects see a screen asking them to wait until the others are ready and they should not do anything while waiting. The cursor is hidden using HideCursors() during that period and at no point in the subroutine I'm calling GetClicks().
 

Roughly, how my code works is that on one of the four PCs (let us name it master) there are four files, named playersReadyCheck1, playersReadyCheck2, playersReadyCheck3, & playersReadyCheck4. Initially, they are set to zero. Assuming PC1 reaches the waiting period, it sets playersReadyCheck1 to 1, saves it on the harddrive of the master and continues to load the other three files playersReadyCheck2, playersReadyCheck3, & playersReadyCheck4. As soon as their sum is 4 (indicating that all other PCs have reached that point in the experiment), PC1 it sets playersReadyCheck1 back to 0, saves it, and continues in the main routine. So do the other PCs, with their respective numbers. In order to avoid problems (which I had previously) that two PCs try to load one of the playersReadyCheck-files simultaneously, I have included those loads in try/catch loops, which might be the problem.


However, unfortunately subjects do click at times which leads Matlab to crash in a way that is not recoverable. Therefore, there is not error message that I could use to identify the problem.

Thus, my first idea was to simply disable the mouse when the waiting period starts, so that no button clicks are registered. Then, when all the other subjects are ready, the waiting period stops, and the mouse should be enabled again.

I hope it is clearer like this? If not, I'll be happy to answer your questions.


Any help will be deeply appreciated,

David

Dear David,

I have the same problem as you. Did you find any solutions to your problem ?

Mathieu

Afaik, in general, you can’t on MS-Windows, due to various MS-Windows operating system event processing limitations. At least past attempts at dealing with this cleanly have failed.
You could switch to Linux for a generally better experience. Calling GetMouse in a loop periodically might also help to perform some MS-Windows window system event processing, if what you try to avoid is the “Application not responding” message box. Cfe. the end of KbWait.m.

-mario