draw a circle at the location of clicks mouse
 
 
 
PST User Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



draw a circle at the location of clicks mouse... Expand / Collapse
Author
Message
Posted 8/29/2007 4:51:42 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 9/25/2007 10:42:06 AM
Posts: 3, Visits: 16
Hello everyone,

I want to conduct a spatial memory experiment, in where participants have to remember the last 4 spatial locations of a visual stimulus.
I created a 4X4 matrix where a circle appears sequentially in different squares. The participant have to click on the last 4 squares occupied by the circle. I want now to collect the mouse responses (i.e., to draw a circle in the square where the participant clicked with the left button of the mouse).

My problem is that I created the matrix as an InLine object (written in e-basic). I do not use a slide or a text display or an Image display. As such, I cannot use the HitTest procedure to collect mouse responses. I can have the mouse position (with "MouseDevice.GetCursorPos xCoordinate, yCoordinate"), thus the program draws a circle at every position of the mouse; but not the mouse position of the click (the response)!!

Does anyone have an idea to help me in this task? I tried a lot of procedures and none succeeded...

Thank you in advance for your help,

Cedric.

Post #587
Posted 8/29/2007 10:33:54 AM
Forum MVP

Forum MVPForum MVPForum MVPForum MVPForum MVPForum MVPForum MVPForum MVP

Group: Administrators
Last Login: Today @ 9:26:59 AM
Posts: 576, Visits: 1,254
You can accomplish this by having a zero duration Wait object with a Mouse with extended time limit get the mouse responses for you and then an InLine to handle the responses.  Please take a look at the attached.  This is a modification of the Process Responses Template sample.

The attached uses PointInRect to determine if the mouse click was within one of the matrix values.  Update it to determine the matrix you have setup in your drawing InLine.

-Brandon

  Post Attachments 
ClickMatrix.es (28 views, 12.92 KB)

Post #588
Posted 9/3/2007 4:23:24 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 9/25/2007 10:42:06 AM
Posts: 3, Visits: 16
dear Brandon,

thank you very much for your answer. It really helps me.

However, I have also a problem. When I integrated your script to my experiment design, the program runs correctly but the mouse response (the left button click) elicits a new trial (that is the matrix with the new stimuli appearing int the designated squares), and never displays the expected circle at the click location...

I assume that I should define parameters where you wrote "Insert custom action here." in the process response, but I do not know exactly what...parameters for the ResponseCount? Other?

Cedric.

Post #593
Posted 9/3/2007 5:05:20 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 9/25/2007 10:42:06 AM
Posts: 3, Visits: 16
I found the solution....

I forgot to parameter the max count in the response object properties.

It's now done. The experiment runs correctly.

Thanks for all,

Cedric.

Post #596
« Prev Topic | Next Topic »


Permissions Expand / Collapse

All times are GMT -5:00, Time now is 10:27pm

Powered By InstantForum.NET v4.1.4 © 2009
Execution: 0.141. 17 queries. Compression Disabled.