show error when mouse moves outside of image


Author
Message
peter.k.p
peter.k.p
Respected Member (378 reputation)Respected Member (378 reputation)Respected Member (378 reputation)Respected Member (378 reputation)Respected Member (378 reputation)Respected Member (378 reputation)Respected Member (378 reputation)Respected Member (378 reputation)Respected Member (378 reputation)
Group: Forum Members
Posts: 13, Visits: 307
Hi there,
I am having the following setup: Two images are displayed on the screen and one of them is to be selected by clicking on it. Once the mouse has moved over one of the images I want to restrict the mouse movement. The mouse is not supposed to move out of the image and when it does an error message is supposed to be displayed. So far I have the following which does not work:

<trial clickresponse>
/ ontrialbegin = [
        values.starttime = script.elapsedtime;
        values.errortype = 1]
/ stimulusframes = [1=left, right, stim_left, default_stim_right]
/ inputdevice = mouse
// validresponse = (left,right)
/ isvalidresponse = [
    if(trial.clickresponse.responsey > shape.left.bottom) {
        return trial.error
    }
]
</trial>


Any help is appreciated, thank you :)

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Reading This Topic

Explore
Messages
Mentions
Search