Setting mouse response options

Francisco Tornay ftornay at ugr.es
Tue Nov 12 16:24:49 UTC 2002


At 11:50 11/11/02 -0500, you wrote:
>Hi All,
>I would very much appreciate some help with the following problem:
>I have an experiment where participants have to click on an appropriate
>part of the screen to make their response.  There are two boxes (called
>'Left' and 'Right')
>on the screen where they can respond (one correct, the other incorrect).
>I have managed to get this working - left and right are text boxes in a
>slide display and are set as attributes in the List.  My problem is how to
>make these boxes the only allowable responses,  i.e. if they click
>anywhere else on the screen, nothing should happen.
>I have tried putting [Left][Right] in the Allowable response box in the
>Properties page of the display.  however, when I do this, I get an error:

[snip]

Try this:

dim rdMouse as MouseResponseData
dim strhit as string

Set rdMouse = CMouseResponseData(Slide1.InputMasks.Item(1).Responses(1))

strhit =  Slide1.states("default").hittest(rdMouse.Cursorx, rdMouse.CursorY)

if strhit = "" then goto again


'Add code to handle the mouse response

I am assuming that

1) the name of your slide object is slide1
2) the name of the slidestate object is default
3) The first inputmask is that of the mouse
4) you have a label called "again" before the slide object, so that the
"goto again" line takes you back to the beginning of the trial


Hope this helps

Francisco Tornay



More information about the Eprime mailing list