+x+x+x+x+xHi all.
In my study participants will move a mouse over a board (think Ouija board). I need the mouse to auto left click after a set period of time (hopefully on a target object). This will end the trial and record the object clicked on (if any). The hard bit is to to get the mouse to auto left click after a set period of time. Can any you you lovely people help me with this please.
Many thanks.
Peter
There is no way to make the mouse auto-left-click. You can, however, have the trial end after a set amount of time by specifying a /timeout (if you want to specify a maximum duration) or /trialduration (if you want to specify a fixed duration). You can record the mouse's x and y coordinates /ontrialend even if there is no click, by loggin the mouse.x and mouse.y properties.
hi could you possibly be kind enough to show me how to record mouse x and y coordinates /ontrialend, as i have only ever recorded stimulus responses.
many thanks
Peter
Like so.
<block exampleblock>
/ postinstructions = (end)
/ trials = [
1=exampletrial;
]
</block>
<values>
/ x = -1
/ y = -1
</values>
<trial exampletrial>
/ ontrialend = [
values.x = mouse.x;
values.y = mouse.y;
]
/ stimulusframes = [1=exampletext]
/ inputdevice = mouse
/ validresponse = (0)
/ trialduration = 5000
</trial>
<text exampletext>
/ items = ("This trial will last 5 seconds. Move the mouse around, the coordinates at the end of the 5 seconds will be captured.")
/ size = (80%, 40%)
</text>
<page end>
^The mouse was at the following position:
^<%values.x%> pixels horizontal & <%values.y%> pixels vertical
</page>
<data>
/ columns = (date time subject group blocknum blockcode
trialnum trialcode stimulusitem response latency correct
mouse.x mouse.y)
/ separatefiles = true
</data>
That's awesome thank you so much
Hi
we are creating a Ouija board style study that will involve no mouse button clicking. We have a search trial were the mouse is moved around and then a selection trial where they receive feedback based on their mouse position. The search trial is currently being timed out at the block level (Block.move). This is not what we intended.
what I cannot seem to do is to adjust the script so that the trial ends after the mouse comes to rest for a second or two, but no button is pressed. To achieve this I have searched for some kind of an iteration counter that would allow me to compare mouse values.x and values.y coordinates over a few iterations of the trial loop to see if they change, then if they do not change for a given number of iterations, branch to trial.select. unfortunately, I do not seem able to get this to work.
Is this possible? if not can you please suggest another way of ending the trial.search by resting the mouse for a period of time. It would also be helpful if this function only happened after a few seconds in case there is a delay between the start of the trial and participants starting their mouse movement.
To summarise, I am aiming for trial.search to start, then after 2 seconds a mechanism is activated that means stopping the mouse movement (for about a second) results in trial.search ending and the commencement of trial.select.
I would be very appreciative for any help given.
Many thanks
Peter
<expt main>
/ blocks = [1= instructions; 2=Move; 3=select; 3=Move; 4=select; 5=Move; 6=select; 7=Move; 8=select; 9=debrief]
/onexptend = [values.completed = 1]
</expt>
<block Move>
/ trials = [1 = search]
/ timeout= (8000)
</block>
<trial search>
/ stimulusframes = [1=clearscreen, bord, viewhole]
/ ontrialbegin=[values.trialcounter = values.trialcounter + 1]
/ ontrialbegin = [picture.bord.hposition = 1px * mouse.x;picture.bord.vposition = 1px * mouse.y;]
/ inputdevice = mouse
/ validresponse = (mousemove)
/ branch = [trial.search]
/ recorddata = false
</trial>
<block select>
/ trials = [1 = select]
</block>
<trial select>
/ stimulusframes = [1= Gray_Background, Black1, Black2, Black3, Black4, bord, viewhole]
/ validresponse = ( Black1, Black2, Black3, Black4)
/ recorddata = false
/ timeout= (10)
/ recorddata = true
/ ontrialend = [values.x = mouse.x; values.y = mouse.y;]
/ branch = [if (trial.select.response == "black1")trial. win]
/ branch = [if (trial.select.response == "black2")trial. lose]
/ branch = [if (trial.select.response == "black3")trial. lose]
/ branch = [if (trial.select.response == "black4")trial. win]
</trial>