Docs @ Psychtoolbox Wiki : SetMouse

Search PTB Function help:
homepsychtoolbox.orgpage updateslogin

Revision [14241]

Last edited on 2011-08-25 07:45:55 by DocBot
Additions:
SetMouse(x, y [, windowPtrOrScreenNumber][, mouseid])
Position the mouse cursor on the screen.
On Linux, the optional 'mouseid' parameter allows to select which
of potentially multiple cursors should be repositioned. On OS/X and
Windows this parameter is silently ignored.
Deletions:
SetMouse(x,y,[windowPtrOrScreenNumber])


Revision [12086]

Edited on 2010-12-06 10:26:09 by DocBot
Additions:
"http://svn.berlios.de/svnroot/repos/osxptb/beta/Psychtoolbox/PsychBasic/SetMouse.m">beta</a> | view WebSVN <a href=
"http://svn.berlios.de/wsvn/osxptb/trunk/Psychtoolbox/PsychBasic/SetMouse.m?op=log">changelog</a> of trunk branch</span>
Deletions:
"http://svn.berlios.de/svnroot/repos/osxptb/beta/Psychtoolbox/PsychBasic/SetMouse.m">beta</a> | view in <a href=
"http://svn.berlios.de/wsvn/osxptb/beta/Psychtoolbox/PsychBasic/SetMouse.m?view=markup">WebSVN with changelog</a></span>


Revision [10111]

Edited on 2010-09-09 15:25:42 by DocBot
Additions:
"http://svn.berlios.de/wsvn/osxptb/beta/Psychtoolbox/PsychBasic/SetMouse.m?view=markup">WebSVN with changelog</a></span>
Deletions:
"http://svn.berlios.de/viewcvs/osxptb/beta/Psychtoolbox/PsychBasic/SetMouse.m?view=markup">WebSVN with changelog</a></span>


Revision [7603]

Edited on 2008-09-25 18:09:22 by DocBot
Additions:
""
<div class="code_header" style="text-align:right;">
<span style="float:left;">Path  </span> <span class="counter">Retrieve current version of SetMouse.m from berliOS: <a href=
"http://svn.berlios.de/svnroot/repos/osxptb/beta/Psychtoolbox/PsychBasic/SetMouse.m">beta</a> | view in <a href=
"http://svn.berlios.de/viewcvs/osxptb/beta/Psychtoolbox/PsychBasic/SetMouse.m?view=markup">WebSVN with changelog</a></span>
</div>
<div class="code">
<code>Psychtoolbox/PsychBasic/SetMouse.m</code>
</div>
""
Deletions:
%%(php;Path)Psychtoolbox/PsychBasic/SetMouse.m%%


Revision [5203]

Edited on 2008-06-15 19:57:19 by DocBot
Additions:
==[[Psychtoolbox]] › [[PsychBasic]]==
Deletions:
==[[Psychtoolbox]] › PsychBasic==


Revision [2797]

Edited on 2008-03-21 03:35:12 by DocBot
Additions:
==[[Psychtoolbox]] › PsychBasic==
SetMouse(x,y,[windowPtrOrScreenNumber])
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).
=== OS 9 ===
After calling SetMouse, there's a short period (until the next tick?)
during which GetMouse reports the old position, after which it reports
the new position. To be conservative, you can code as follows:
while 1
SetMouse(theX,theY);
[checkX,checkY] = GetMouse;
if (checkX""==""theX) & (checkY""==""theY)
break;
end
end
Cursor updating is usually carried out by a System task that runs once
per tick, so it's likely that SetMouse doesn't take effect until the
next tick. Instead of the elaborate check suggested above, it might
be enough, after calling SetMouse, to simply WaitTicks(1) before calling
GetMouse to be sure of getting the new position.
=== OS-X, Linux & WINDOWS ===
Psychtoolbox will accept the optional windowPtrOrScreenNumber
argument and check it for validity. However, supplying the argument will
not influence the position of the mouse cursor. The cursor is always
positioned in absolute coordinates on the main screen. It does not
matter that the cursor is always positioned in absolute coordinates,
because in Windows onscreen windows are always the full size of the
display, absolute and relative coordinates are always the same. It would
be good if SetMouse could position the mouse cursor on secondary
displays, but we dont' support multiple displays yet in Windows.
The delay between a call to SetMouse and when GetMouse will report the
new mouse cursor position is not known. GetMouse seems to report the new
position immediately, but we have no guarantee that it always will.
----
See Also: GetMouse, GetClicks
%%(php;Path)Psychtoolbox/PsychBasic/SetMouse.m%%
Deletions:
==PtbReference › PsychBasic==
SetMouse(x,y,[windowPtrOrScreenNumber])
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).
OS 9: ___________________________________________________________________

After calling SetMouse, there's a short period (until the next tick?)
during which GetMouse reports the old position, after which it reports
the new position. To be conservative, you can code as follows:
while 1
SetMouse(theX,theY);
[checkX,checkY] = GetMouse;
if (checkX==theX) & (checkY==theY)
break;
end
end

Cursor updating is usually carried out by a System task that runs once
per tick, so it's likely that SetMouse doesn't take effect until the
next tick. Instead of the elaborate check suggested above, it might
be enough, after calling SetMouse, to simply WaitTicks(1) before calling
GetMouse to be sure of getting the new position.

OS-X, Linux & WINDOWS:___________________________________________________

Psychtoolbox will accept the optional windowPtrOrScreenNumber
argument and check it for validity. However, supplying the argument will
not influence the position of the mouse cursor. The cursor is always
positioned in absolute coordinates on the main screen. It does not
matter that the cursor is always positioned in absolute coordinates,
because in Windows onscreen windows are always the full size of the
display, absolute and relative coordinates are always the same. It would
be good if SetMouse could position the mouse cursor on secondary
displays, but we dont' support multiple displays yet in Windows.

The delay between a call to SetMouse and when GetMouse will report the
new mouse cursor position is not known. GetMouse seems to report the new
position immediately, but we have no guarantee that it always will.

_________________________________________________________________________

See Also: GetMouse, GetClicks
PsychBasic


Revision [2399]

Edited on 2008-03-15 12:08:15 by DocBot
Additions:
===[[SetMouse]]===
==PtbReference › PsychBasic==
Deletions:
===PsychBasic===


Revision [281]

The oldest known version of this page was created on 2008-03-15 10:26:18 by DocBot
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki
Page was generated in 0.0191 seconds