count mouse clicking


count mouse clicking

Author
Message
luhe
luhe
New Member
New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)

Group: Forum Members
Posts: 2, Visits: 2
Dear Inquisit community,

Is there a way to obtain the amount of mouse clicks that the subject has made per trial?
I'm using a reaction time task and want to give a warning in case participants click the mouse permanently to be as quick as possible once the target stimulus is presented.

Thanks in advance!
Best regards,
Lu

Dave
Dave
Supreme Being
Supreme Being (512K reputation)Supreme Being (512K reputation)Supreme Being (512K reputation)Supreme Being (512K reputation)Supreme Being (512K reputation)Supreme Being (512K reputation)Supreme Being (512K reputation)Supreme Being (512K reputation)Supreme Being (512K reputation)

Group: Administrators
Posts: 9.2K, Visits: 39K
luhe - Wednesday, October 24, 2018
Dear Inquisit community,

Is there a way to obtain the amount of mouse clicks that the subject has made per trial?
I'm using a reaction time task and want to give a warning in case participants click the mouse permanently to be as quick as possible once the target stimulus is presented.

Thanks in advance!
Best regards,
Lu

You can theoretically count the clicks per a bit of /isvalidresponse logic. Basically something like this:

<values>
/ pretargetclicks = 0
</values>

<block myblock>
/ trials = [1-4 = mytrial]
</block>

<trial mytrial>
/ ontrialbegin = [values.pretargetclicks=0]
/ stimulustimes = [0=fixation; 3000=target]
/ inputdevice = mouse
/ validresponse = (lbuttondown)
/ isvalidresponse = [if(trial.mytrial.response == "lbuttondown" && trial.mytrial.latency <= 3000) {values.pretargetclicks+=1; false} else true]
/ beginresponsetime = 0
/ branch = [if (values.pretargetclicks > 0) trial.warning]
</trial>

<trial warning>
/ stimulusframes = [1=warningmsg]
/ validresponse = (0)
/ trialduration = 2000
</trial>

<text fixation>
/ items = ("+")
</text>

<text target>
/ items = ("A", "B", "C", "D")
</text>

<text warningmsg>
/ items = ("You clicked <%values.pretargetclicks%> times before the target appeared. Please don't do this.")
/ txcolor = red
</text>



luhe
luhe
New Member
New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)New Member (12 reputation)

Group: Forum Members
Posts: 2, Visits: 2
Dave - Wednesday, October 24, 2018
luhe - Wednesday, October 24, 2018
Dear Inquisit community,

Is there a way to obtain the amount of mouse clicks that the subject has made per trial?
I'm using a reaction time task and want to give a warning in case participants click the mouse permanently to be as quick as possible once the target stimulus is presented.

Thanks in advance!
Best regards,
Lu

You can theoretically count the clicks per a bit of /isvalidresponse logic. Basically something like this:

<values>
/ pretargetclicks = 0
</values>

<block myblock>
/ trials = [1-4 = mytrial]
</block>

<trial mytrial>
/ ontrialbegin = [values.pretargetclicks=0]
/ stimulustimes = [0=fixation; 3000=target]
/ inputdevice = mouse
/ validresponse = (lbuttondown)
/ isvalidresponse = [if(trial.mytrial.response == "lbuttondown" && trial.mytrial.latency <= 3000) {values.pretargetclicks+=1; false} else true]
/ beginresponsetime = 0
/ branch = [if (values.pretargetclicks > 0) trial.warning]
</trial>

<trial warning>
/ stimulusframes = [1=warningmsg]
/ validresponse = (0)
/ trialduration = 2000
</trial>

<text fixation>
/ items = ("+")
</text>

<text target>
/ items = ("A", "B", "C", "D")
</text>

<text warningmsg>
/ items = ("You clicked <%values.pretargetclicks%> times before the target appeared. Please don't do this.")
/ txcolor = red
</text>



Hi Dave,

Thank you very much for your quick response!

Cheers,
Lutz

GO


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....






Millisecond Forums


Search