Additions:
[x,y,buttons,focus,valuators,valinfo] = GetMouse([windowPtrOrScreenNumber][, mouseDev])
The optional 'mouseDev' parameter allows to select a specific mouse or
pointer device to query if your system has multiple pointer devices.
Currently Linux only, silently ignored on other operating systems.
On Linux, the optional 'valuator' return argument contains the current
values of all axis on a multi-axis device, ie., a device which not only
has an x- and y-axis like a conventional mouse. E.g., digitizer tablets
(like the "Wacom" pen tablets), may also have axis (also called "valuators")
which report pen rotation, pen tilt and yaw angle wrt. the tablet surface,
distance to the tablet surface, or normal and tangential pen pressure.
Touchpads or trackpads may return contact area with the finger, or pressure.
Joysticks may return info about additional sliders, wheels or other controls
beyond the deflection of the joystick itself.
'valuators' is a vector with one double value per axis on Linux. On OS/X
or MS-Windows, valuator is an empty matrix.
The optional 'valinfo' struct array contains one struct per valuator.
The struct contains fields with info about a valuator, e.g., minimum
and maximum value, resolution and a label. This is only supported on Linux.
On other systems it is an empty matrix.
many values as your mouse has buttons. GetMouse can't distinguish between
multiple mice and will always return the unified state of all mice.
=== LINUX ===
GetMouse can distinguish between multiple mouse-like devices. It can return
information about additional axis (valuators). GetMouse not only returns
status info about mouse/trackpad/trackball devices, but also info about
Pen digitizer tablets (e.g., Wacom tablets), touch pads and touch screens,
and joystick/gamepad devices. Usually you'd use the GamePad() function though
for Joystick/Gamepad query.
return the state of three buttons. GetMouse can't distinguish between
multiple mice and will always return the unified state of all mice.
Deletions:
[x,y,buttons,focus] = GetMouse([windowPtrOrScreenNumber])
many values as your mouse has buttons.
return the state of three buttons.
Additions:
[x,y,buttons,focus] = GetMouse([windowPtrOrScreenNumber])
false (0) otherwise.
If an optional windowPtr argument for an onscreen window is provided,
GetMouse will also return the window focus state as optional 4th
return argument 'focus'. 'focus' is 1 if the window has input focus
and zero otherwise.
"http://svn.berlios.de/svnroot/repos/osxptb/beta/Psychtoolbox/PsychBasic/GetMouse.m">beta</a> | view WebSVN <a href=
"http://svn.berlios.de/wsvn/osxptb/trunk/Psychtoolbox/PsychBasic/GetMouse.m?op=log">changelog</a> of trunk branch</span>
Deletions:
[x,y,buttons] = GetMouse([windowPtrOrScreenNumber])
false (0) otherwise.
"http://svn.berlios.de/svnroot/repos/osxptb/beta/Psychtoolbox/PsychBasic/GetMouse.m">beta</a> | view in <a href=
"http://svn.berlios.de/wsvn/osxptb/beta/Psychtoolbox/PsychBasic/GetMouse.m?view=markup">WebSVN with changelog</a></span>
Additions:
"http://svn.berlios.de/wsvn/osxptb/beta/Psychtoolbox/PsychBasic/GetMouse.m?view=markup">WebSVN with changelog</a></span>
Deletions:
"http://svn.berlios.de/viewcvs/osxptb/beta/Psychtoolbox/PsychBasic/GetMouse.m?view=markup">WebSVN with changelog</a></span>
Additions:
""
<div class="code_header" style="text-align:right;">
<span style="float:left;">Path </span> <span class="counter">Retrieve current version of GetMouse.m from berliOS: <a href=
"http://svn.berlios.de/svnroot/repos/osxptb/beta/Psychtoolbox/PsychBasic/GetMouse.m">beta</a> | view in <a href=
"http://svn.berlios.de/viewcvs/osxptb/beta/Psychtoolbox/PsychBasic/GetMouse.m?view=markup">WebSVN with changelog</a></span>
</div>
<div class="code">
<code>Psychtoolbox/PsychBasic/GetMouse.m</code>
</div>
""
Deletions:
%%(php;Path)Psychtoolbox/PsychBasic/GetMouse.m%%
Additions:
==[[Psychtoolbox]] › [[PsychBasic]]==
NOTE: GetMouse no longer supports this obsolete usage:
Deletions:
==[[Psychtoolbox]] › PsychBasic==
=== NOTE: GetMouse no longer supports this obsolete usage: ===
Additions:
[x,y,buttons] = GetMouse([windowPtrOrScreenNumber])
Returns the current (x,y) position of the cursor and the up/down state
of the mouse buttons. "buttons" is a 1xN matrix where N is the number of
mouse buttons. Each element of the matrix represents one mouse button.
The element is true (1) if the corresponding mouse button is pressed and
false (0) otherwise.
% Test if any mouse button is pressed.
if any(buttons)
fprintf('Someone""''""s pressing a button.\n');
end
% Test if the first mouse button is pressed.
if buttons(1)
fprintf('Someone""''""s pressing the first button!\n');
end
% Test if the second mouse button is pressed.
if length(buttons)>=2 & buttons(2)
fprintf('Someone""''""s pressing the second button!\n');
end
length(buttons) tells you how many buttons there are on your mouse.
The cursor position (x,y) is "local", i.e. relative to the origin of
the window or screen, if supplied. Otherwise it's "global", i.e. relative
to the origin of the main screen (the one with the menu bar).
NOTE: If you use GetMouse to wait for clicks, don't forget to wait
for the user to release the mouse button, ending the current click, before
you begin waiting for the next mouse press.
Alternatively, you can also use the GetClicks() function to wait for
mouse-clicks and return the mouse position of first click and the number
of mouse button clicks.
fprintf('Please click the mouse now.\n');
[x,y,buttons] = GetMouse;
while any(buttons) % if already down, wait for release
end
while ~any(buttons) % wait for press
end
while any(buttons) % wait for release
end
fprintf('You clicked! Thanks.\n');
=== NOTE: GetMouse no longer supports this obsolete usage: ===
xy = GetMouse([windowPtrOrScreenNumber])
where xy is a 1x2 vector containing the x, y coordinates.
=== OS X ===
Even if your mouse has more than three buttons, GetMouse will return as
many values as your mouse has buttons.
=== M$-Windows ===
=== Limitations: ===
GetMouse will always assume a three button mouse and therefore always
return the state of three buttons.
See also: GetClicks, SetMouse
Deletions:
[x,y,buttons] = GetMouse([windowPtrOrScreenNumber])
Returns the current (x,y) position of the cursor and the up/down state
of the mouse buttons. "buttons" is a 1xN matrix where N is the number of
mouse buttons. Each element of the matrix represents one mouse button.
The element is true (1) if the corresponding mouse button is pressed and
false (0) otherwise.
% Test if any mouse button is pressed.
if any(buttons)
fprintf('Someone""''""s pressing a button.\n');
end
% Test if the first mouse button is pressed.
if buttons(1)
fprintf('Someone""''""s pressing the first button!\n');
end
% Test if the second mouse button is pressed.
if length(buttons)>=2 & buttons(2)
fprintf('Someone""''""s pressing the second button!\n');
end
length(buttons) tells you how many buttons there are on your mouse.
The cursor position (x,y) is "local", i.e. relative to the origin of
the window or screen, if supplied. Otherwise it's "global", i.e. relative
to the origin of the main screen (the one with the menu bar).
NOTE: If you use GetMouse to wait for clicks, don't forget to wait
for the user to release the mouse button, ending the current click, before
you begin waiting for the next mouse press.
Alternatively, you can also use the GetClicks() function to wait for
mouse-clicks and return the mouse position of first click and the number
of mouse button clicks.
fprintf('Please click the mouse now.\n');
[x,y,buttons] = GetMouse;
while any(buttons) % if already down, wait for release
end
while ~any(buttons) % wait for press
end
while any(buttons) % wait for release
end
fprintf('You clicked! Thanks.\n');
=== NOTE: GetMouse no longer supports this obsolete usage: ===
xy = GetMouse([windowPtrOrScreenNumber])
where xy is a 1x2 vector containing the x, y coordinates.
=== OS X ===
Even if your mouse has more than three buttons, GetMouse will return as
many values as your mouse has buttons.
=== M$-Windows ===
=== Limitations: ===
GetMouse will always assume a three button mouse and therefore always
return the state of three buttons.
See also: GetClicks, SetMouse
Additions:
[x,y,buttons] = GetMouse;
[x,y,buttons] = GetMouse;
[x,y,buttons] = GetMouse;
Deletions:
[x,y,buttons] = GetMouse;
[x,y,buttons] = GetMouse;
[x,y,buttons] = GetMouse;
Additions:
==[[Psychtoolbox]] › PsychBasic==
[x,y,buttons] = GetMouse([windowPtrOrScreenNumber])
Returns the current (x,y) position of the cursor and the up/down state
of the mouse buttons. "buttons" is a 1xN matrix where N is the number of
mouse buttons. Each element of the matrix represents one mouse button.
The element is true (1) if the corresponding mouse button is pressed and
false (0) otherwise.
% Test if any mouse button is pressed.
if any(buttons)
fprintf('Someone""''""s pressing a button.\n');
end
% Test if the first mouse button is pressed.
if buttons(1)
fprintf('Someone""''""s pressing the first button!\n');
end
% Test if the second mouse button is pressed.
if length(buttons)>=2 & buttons(2)
fprintf('Someone""''""s pressing the second button!\n');
end
length(buttons) tells you how many buttons there are on your mouse.
The cursor position (x,y) is "local", i.e. relative to the origin of
the window or screen, if supplied. Otherwise it's "global", i.e. relative
to the origin of the main screen (the one with the menu bar).
NOTE: If you use GetMouse to wait for clicks, don't forget to wait
for the user to release the mouse button, ending the current click, before
you begin waiting for the next mouse press.
Alternatively, you can also use the GetClicks() function to wait for
mouse-clicks and return the mouse position of first click and the number
of mouse button clicks.
fprintf('Please click the mouse now.\n');
[x,y,buttons] = GetMouse;
while any(buttons) % if already down, wait for release
[x,y,buttons] = GetMouse;
end
while ~any(buttons) % wait for press
[x,y,buttons] = GetMouse;
end
while any(buttons) % wait for release
[x,y,buttons] = GetMouse;
end
fprintf('You clicked! Thanks.\n');
=== NOTE: GetMouse no longer supports this obsolete usage: ===
xy = GetMouse([windowPtrOrScreenNumber])
where xy is a 1x2 vector containing the x, y coordinates.
=== OS X ===
Even if your mouse has more than three buttons, GetMouse will return as
many values as your mouse has buttons.
----
=== M$-Windows ===
=== Limitations: ===
GetMouse will always assume a three button mouse and therefore always
return the state of three buttons.
----
See also: GetClicks, SetMouse
%%(php;Path)Psychtoolbox/PsychBasic/GetMouse.m%%
Deletions:
==PtbReference › PsychBasic==
[x,y,buttons] = GetMouse([windowPtrOrScreenNumber])
Returns the current (x,y) position of the cursor and the up/down state
of the mouse buttons. "buttons" is a 1xN matrix where N is the number of
mouse buttons. Each element of the matrix represents one mouse button.
The element is true (1) if the corresponding mouse button is pressed and
false (0) otherwise.
% Test if any mouse button is pressed.
if any(buttons)
fprintf('Someone''s pressing a button.\n');
end
% Test if the first mouse button is pressed.
if buttons(1)
fprintf('Someone''s pressing the first button!\n');
end
% Test if the second mouse button is pressed.
if length(buttons)>=2 & buttons(2)
fprintf('Someone''s pressing the second button!\n');
end
length(buttons) tells you how many buttons there are on your mouse.
The cursor position (x,y) is "local", i.e. relative to the origin of
the window or screen, if supplied. Otherwise it's "global", i.e. relative
to the origin of the main screen (the one with the menu bar).
NOTE: If you use GetMouse to wait for clicks, don't forget to wait
for the user to release the mouse button, ending the current click, before
you begin waiting for the next mouse press.
Alternatively, you can also use the GetClicks() function to wait for
mouse-clicks and return the mouse position of first click and the number
of mouse button clicks.
fprintf('Please click the mouse now.\n');
[x,y,buttons] = GetMouse;
while any(buttons) % if already down, wait for release
[x,y,buttons] = GetMouse;
end
while ~any(buttons) % wait for press
[x,y,buttons] = GetMouse;
end
while any(buttons) % wait for release
[x,y,buttons] = GetMouse;
end
fprintf('You clicked! Thanks.\n');
NOTE: GetMouse no longer supports this obsolete usage:
xy = GetMouse([windowPtrOrScreenNumber])
where xy is a 1x2 vector containing the x, y coordinates.
OS X: ___________________________________________________________________
Even if your mouse has more than three buttons, GetMouse will return as
many values as your mouse has buttons.
_________________________________________________________________________
M$-Windows: _____________________________________________________________
Limitations:
GetMouse will always assume a three button mouse and therefore always
return the state of three buttons.
_________________________________________________________________________
See also: GetClicks, SetMouse
PsychBasic
Additions:
===[[GetMouse]]===
==PtbReference › PsychBasic==
Deletions:
===PsychBasic===