# getmouse doesn&#39;t return buttons

**URL:** <https://psychtoolbox.discourse.group/t/getmouse-doesn-39-t-return-buttons/1119>\
**Category:** Uncategorized\
**Created:** [February 5, 2004, 7:40pm UTC](https://psychtoolbox.discourse.group/t/getmouse-doesn-39-t-return-buttons/1119 "2004-02-05T19:40:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allen\_Ingling](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Allen\_Ingling](https://psychtoolbox.discourse.group/u/Allen_Ingling)\
**Post date:** [February 5, 2004, 7:40pm UTC](https://psychtoolbox.discourse.group/t/getmouse-doesn-39-t-return-buttons/1119/1 "2004-02-05T19:40:44Z")

</div>

In my last message I said that getmouse would not return info on   
buttons. I'm using Win 2000, three button USB mouse, MATLAB 6.5, and   
latest version of psychtoolbox.  
  
None of these code variants will detect mouse button presses:  
  
buttons = 0;  
while ~any(buttons);  
[x,y,buttons]=getmouse;  
end;  
  
ptr=screen(0,'openwindow',255,[],8);  
buttons = 0;  
while ~any(buttons);  
[x,y,buttons]=getmouse(ptr);  
end;  
screen(ptr,'close');  
  
As a matter of fact, buttons only comes back as a single zero instead   
of a 1x3 matrix. x and y come back as they should. i.e. No problem   
detecting pointer position.  
  
Thanks again for any help.   
Pat
