﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Millisecond Forums » Millisecond Forums » Inquisit 3  » Set mouse coordinates</title><generator>InstantForum 2017-1 Final</generator><description>Millisecond Forums</description><link>https://forums.millisecond.com/</link><webMaster>Millisecond Forums</webMaster><lastBuildDate>Wed, 20 May 2026 01:26:37 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Set mouse coordinates</title><link>https://forums.millisecond.com/Topic3976.aspx</link><description>&lt;p&gt;Uh, didn't know that works. If you wish to issue an error message when a subject does not hit the black dot, the code reduces to &lt;/p&gt;

&lt;p&gt;&amp;lt;values&amp;gt;&lt;br /&gt;/ centeringtext=""&lt;br /&gt;&amp;lt;/values&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;text TEXT_centering&amp;gt;&lt;br /&gt;/ items = ("&amp;lt;%values.centeringtext%&amp;gt;")&lt;br /&gt;/ position = (50,40)&lt;br /&gt;&amp;lt;/text&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;trial TRIAL_centering&amp;gt;&lt;br /&gt;/ branch = if(trial.TRIAL_centering.correct==0) TRIAL_centering&lt;br /&gt;/ ontrialend = [values.centeringtext="Your mouse cursor did not hit the black dot. Please try again."]&lt;br /&gt;/ inputdevice = mouse&lt;br /&gt;/ validresponse = (anyresponse)&lt;br /&gt;/ correctresponse = (PIC_centerspot)&lt;br /&gt;/ responseinterrupt = trial&lt;br /&gt;/ stimulusframes = [1 = sequence(TEXT_centering,PIC_centerspot)]&lt;br /&gt;&amp;lt;/trial&amp;gt;&lt;/p&gt;</description><pubDate>Mon, 22 Feb 2010 10:32:23 GMT</pubDate><dc:creator>Blackadder</dc:creator></item><item><title>RE: Set mouse coordinates</title><link>https://forums.millisecond.com/Topic3973.aspx</link><description>&lt;p&gt;[quote]/ branch =
[if(sqrt(pow(trial.TRIAL_centering.responsex-values.screencenter.x,2) +
pow(trial.TRIAL_centering.responsey-values.screencenter.y,2)) &amp;gt;
values.centertolerance) TRIAL_centering][/quote]&lt;/p&gt;
&lt;p&gt;Nice! However that's really a little too cumbersome for my tastes. Why not simply define a &amp;lt;shape&amp;gt; that covers your "tolerance" area, e.g.&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;&lt;span style="font-family: courier new,courier;"&gt;&amp;lt;shape blackdot&amp;gt;&lt;br /&gt;/ size = &lt;i&gt;whatever you compute it to be&lt;/i&gt;&lt;br /&gt;/ position = (50%, 50%)&lt;br /&gt;[...]&lt;br /&gt;&amp;lt;/shape&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;and then just go for&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;&lt;span style="font-family: courier new,courier;"&gt;&amp;lt;trial 
centermouse&amp;gt;&lt;br /&gt;/ stimulusframes = [1=blackdot]&lt;br /&gt;/ inputdevice =
 mouse&lt;br /&gt;/ validresponse = (blackdot)&lt;br /&gt;&amp;lt;/trial&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;? The trial will only move on if subjects indeed click within the screen region defined / covered by &amp;lt;shape blackdot&amp;gt;. Essentially this should achieve the same thing as your current setup.&lt;/p&gt;
&lt;p&gt;Now beg to differ!&lt;/p&gt;
&lt;p&gt;~Dave&lt;/p&gt;</description><pubDate>Mon, 22 Feb 2010 06:06:05 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Set mouse coordinates</title><link>https://forums.millisecond.com/Topic3972.aspx</link><description>&lt;p&gt;Hi Dave,&lt;/p&gt;
&lt;p&gt;I tend to use the mouse as an input device with a visible mouse cursor only if absolutely necessary, i.e. when a pointing or tracking task is involved. For all other purposes, we had custom response boxes built from ordinary USB keyboards sporting only five buttons, with one box for each hand. Buttons internally map to none-numpad keys 1-5 (right hand) and 6-10 (left hand). Subjects provide responses always with their dominant hand on the respective box. We can thereby warrant that the same finger is associated with the same response regardless of handedness.&lt;/p&gt;
&lt;p&gt;The centering trial came to my mind, too, I was just adding such a thingie to my script when I read your posting. Cumbersome? Yes. Avoidable? No, sadly.&lt;/p&gt;
&lt;p&gt;If anybody is interested in the details of my implementation, the script elements are set up as follows.&lt;/p&gt;

&lt;p&gt;&amp;lt;values&amp;gt;&lt;br /&gt;/ centeringtext=""&lt;br /&gt;/ centertolerance=3px&lt;br /&gt;/ screencenter.x=640px&lt;br /&gt;
/ screencenter.y=512px&lt;br /&gt;
&amp;lt;/values&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;text TEXT_centering&amp;gt;&lt;br /&gt;/ items = ("&amp;lt;%values.centeringtext%&amp;gt;")&lt;br /&gt;/ position = (50,40)&lt;br /&gt;&amp;lt;/text&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;trial TRIAL_centering&amp;gt;&lt;br /&gt;/ branch =
[if(sqrt(pow(trial.TRIAL_centering.responsex-values.screencenter.x,2) +
pow(trial.TRIAL_centering.responsey-values.screencenter.y,2)) &amp;gt;
values.centertolerance) TRIAL_centering]&lt;br /&gt;
/ validresponse = (lbuttonup)&lt;br /&gt;/ responseinterrupt = trial&lt;br /&gt;/ stimulusframes = [1 = sequence(TEXT_centering,PIC_centerspot)]&lt;br /&gt;/ ontrialend = [values.centeringtext="Your mouse cursor is too far off the black dot. Please try again."]&lt;br /&gt;&amp;lt;/trial&amp;gt;&lt;/p&gt;

&lt;p&gt;The expression "sqrt(...)" computes the euclidian distance of the click coordinate to the center of the screen. If the click commenced too far off the center, the trial alters the message issued by TEXT_centering and repeats itself. The values.centeringtext variable is reset to "Please click on the black dot at the center of the screen." by every trial that calls TRIAL_centering.&lt;/p&gt;
&lt;p&gt;Bye, Malte&lt;/p&gt;</description><pubDate>Mon, 22 Feb 2010 05:41:06 GMT</pubDate><dc:creator>Blackadder</dc:creator></item><item><title>RE: Set mouse coordinates</title><link>https://forums.millisecond.com/Topic3971.aspx</link><description>&lt;p&gt;A few workaround strategies, which may or may not be helpful depending on your overall task characteristics:&lt;/p&gt;
&lt;p&gt;(1) Insert a trial element requiring subjects to center the mouse cursor:&lt;/p&gt;
&lt;p style="padding-left: 30px;"&gt;&lt;span style="font-family: courier new,courier;"&gt;&amp;lt;trial centermouse&amp;gt;&lt;br /&gt;/ stimulusframes = [1=centersquare]&lt;br /&gt;/ inputdevice = mouse&lt;br /&gt;/ validresponse = (centersquare)&lt;br /&gt;&amp;lt;/trial&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;shape centersquare&amp;gt;&lt;br /&gt;/ shape = rectangle&lt;br /&gt;/ size = (20px, 20px)&lt;br /&gt;/ position = (50%, 50%)&lt;br /&gt;/ color = (green)&lt;br /&gt;&amp;lt;/shape&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;(2) If your eyetracking trial only involves mouse events as input (lbuttondown, etc.) and does not require subjects to click on a specific stimulus, you can disable the display of the mouse cursor via '/ inputdevice = mousekey' or '/ showmousecursor = false' to avoid visual distractions caused by the cursor position.&lt;/p&gt;
&lt;p&gt;~Dave&lt;/p&gt;</description><pubDate>Mon, 22 Feb 2010 04:01:33 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>RE: Set mouse coordinates</title><link>https://forums.millisecond.com/Topic3970.aspx</link><description>&lt;p&gt;And on the &lt;a href="/forums/Topic3953.aspx"&gt;forum wishlist&lt;/a&gt;, too.&lt;/p&gt;</description><pubDate>Mon, 22 Feb 2010 03:50:46 GMT</pubDate><dc:creator>Blackadder</dc:creator></item><item><title>RE: Set mouse coordinates</title><link>https://forums.millisecond.com/Topic3966.aspx</link><description>&lt;p&gt;As far as I know, setting the mouse cursor to a predefined position is not possible currently. I think this is kind of a bummer, and that's why this feature suggestion is on my personal Inquisit wishlist...;-)&lt;/p&gt;
&lt;p&gt;~Dave&lt;/p&gt;</description><pubDate>Mon, 22 Feb 2010 03:30:43 GMT</pubDate><dc:creator>Dave</dc:creator></item><item><title>Set mouse coordinates</title><link>https://forums.millisecond.com/Topic3965.aspx</link><description>&lt;p&gt;Hi All,&lt;/p&gt;
&lt;p&gt;in an eyetracking paradigm I wish to set the mouse cursor to a specific screen location on each trial in order to prevent that subjects have to search for the mouse cursor. Is something like this possible:&lt;/p&gt;
&lt;p&gt;&amp;lt;trial&amp;gt;&lt;br /&gt;/ ontrialbegin = [mouse.x=50%; mouse.y=50%]&lt;br /&gt;...&lt;br /&gt;&amp;lt;/trial&amp;gt;&lt;/p&gt;

&lt;p&gt;Bye, Malte.&lt;/p&gt;
</description><pubDate>Mon, 22 Feb 2010 03:09:09 GMT</pubDate><dc:creator>Blackadder</dc:creator></item></channel></rss>