bug report: GetMouse and Windows

I've noticed a problem with the GetMouse function on Windows with the
new PsychToolbox (version 3.x). The first time I run a program that
exist a loop upon a button press, the program works fine. Subsequent
times, the program exits immediately, because the GetMouse function
reports that a button is being depressed when the button actually is
not. Quitting Matlab and restarting it seems to solve the problem.

This happened on two different Windows laptops, so I assume it is a
general Windows problem. Each had a recent beta version of the PTB.

Is there some way to clear the mouse buffer (or whatever)? The same
program works fine each time on a Mac.

keith
Hi Mario,

Oh, um... heh. I always tell people to read the help files too.
Well that's strange that "clear mex" doesn't clear the mouse buffer
(or whatever) but quitting Matlab does.

keith

On Aug 17, 2006, at 7:51 PM, Mario Kleiner wrote:

> This is a documented limitation on M$-Windows, see "help GetMouse".
> The workaround is to make sure that the user released all mouse
> buttons before closing the last onscreen window. GetMouse on Windows
> only notices change of mouse button state while at least one onscreen
> window is open. This will need more tinkering to see if we can improve
> on that.
>
> -mario
>
> --- In psychtoolbox@yahoogroups.com, Keith Schneider <ks@...> wrote:
>>
>> I've noticed a problem with the GetMouse function on Windows with the
>> new PsychToolbox (version 3.x). The first time I run a program that
>> exist a loop upon a button press, the program works fine. Subsequent
>> times, the program exits immediately, because the GetMouse function
>> reports that a button is being depressed when the button actually is
>> not. Quitting Matlab and restarting it seems to solve the problem.
>>
>> This happened on two different Windows laptops, so I assume it is a
>> general Windows problem. Each had a recent beta version of the PTB.
>>
>> Is there some way to clear the mouse buffer (or whatever)? The same
>> program works fine each time on a Mac.
>>
>> keith