Mouse Click & Target Task

Paul Groot pfc.groot at gmail.com
Mon Oct 3 22:03:35 UTC 2011


Hi Lucas,

After capturing a mouse click response you could immediately retrieve
the mouse position using a few lines of script:

dim ptMouse as Point
Mouse.GetCursorPos ptMouse.x, ptMouse.y

To determine if this point is inside the drawn circle you could use a
simple calculation: just calculate the (squared) distance between the
center of the circle and the hit point:

Const radius = 10
dim dx as long
dim dy as long
dx = ptMouse.x - center.x
dy = ptMouse.y - center.y
if (dx*dx + dy*dy)<=radius*radius then
   ... inside circle
else
  ... outside circle
end if

I'm not using a square root because it is computationally intensive
and not required because the comparison also holds for squared values.

cheers
paul

2011/10/3 Lucas Hutchison <lahutchi at mtu.edu>:
> I am working on a small experiment where I would like the following:
>
> -Target (20 x 20 pixel red circle) appears at a random location on the
> screen
> -when the target is presented, the participant must click the target
> -once the participant clicks, the next randomly located target will
> appear (and the prior target is removed), and the process repeats for
> n number of trials needed
>
> I am able to display the targets at random locations, but I am unsure
> of how to record the X and Y positions of the click and how to compare
> those to the actual X and Y positions of the target to determine
> accuracy.  I would like to record both the response time and the click
> accuracy.
>
> I have been trying to find resources online and in the help
> documentation, but much of the online code is older than my version
> and some of the methods/ objects they use have been renamed.
>
> I am using E-Prime version 2.0.8.74
>
>
> Thanks for the help!
>
> --
> You received this message because you are subscribed to the Google Groups "E-Prime" group.
> To post to this group, send email to e-prime at googlegroups.com.
> To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.



More information about the Eprime mailing list