mousemove


mousemove

Author
Message
Nakayama Yao
Nakayama Yao
Expert
Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)

Group: Forum Members
Posts: 39, Visits: 230
Hi Inquisit 5 community,

I wish to track the current position of mouse after the mouse starts moving and before the rectangle is clicked, and once the mouse moves outside the rectangle, the trial resets.
Is there a syntax that allows to do this?
Thank you in advance.Wink

<trial tap>
/ ontrialend = [values.trialnum-=1]
/ ontrialbegin = [trial.tap.beginresponsetime = 0

/ ontrialend = [trial.tap.resetstimulusframes()]
/ validresponse = (mousemove)
/ stimulustimes = [0=screen,rectangle]
/ responseinterrupt = frames
/ inputdevice = mouse

</trial>
Dave
Dave
Supreme Being
Supreme Being (418K reputation)Supreme Being (418K reputation)Supreme Being (418K reputation)Supreme Being (418K reputation)Supreme Being (418K reputation)Supreme Being (418K reputation)Supreme Being (418K reputation)Supreme Being (418K reputation)Supreme Being (418K reputation)

Group: Administrators
Posts: 8.9K, Visits: 37K
Nakayama Yao - Tuesday, January 23, 2018
Hi Inquisit 5 community,

I wish to track the current position of mouse after the mouse starts moving and before the rectangle is clicked, and once the mouse moves outside the rectangle, the trial resets.
Is there a syntax that allows to do this?
Thank you in advance.Wink

<trial tap>
/ ontrialend = [values.trialnum-=1]
/ ontrialbegin = [trial.tap.beginresponsetime = 0

/ ontrialend = [trial.tap.resetstimulusframes()]
/ validresponse = (mousemove)
/ stimulustimes = [0=screen,rectangle]
/ responseinterrupt = frames
/ inputdevice = mouse

</trial>

I'm not quite sure I 100% understand what you want to do, but perhaps this bit of code is helpful:
https://www.millisecond.com/forums/FindPost13217.aspx

Nakayama Yao
Nakayama Yao
Expert
Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)

Group: Forum Members
Posts: 39, Visits: 230
Dave - Wednesday, January 24, 2018
Nakayama Yao - Tuesday, January 23, 2018
Hi Inquisit 5 community,

I wish to track the current position of mouse after the mouse starts moving and before the rectangle is clicked, and once the mouse moves outside the rectangle, the trial resets.
Is there a syntax that allows to do this?
Thank you in advance.Wink

<trial tap>
/ ontrialend = [values.trialnum-=1]
/ ontrialbegin = [trial.tap.beginresponsetime = 0

/ ontrialend = [trial.tap.resetstimulusframes()]
/ validresponse = (mousemove)
/ stimulustimes = [0=screen,rectangle]
/ responseinterrupt = frames
/ inputdevice = mouse

</trial>

I'm not quite sure I 100% understand what you want to do, but perhaps this bit of code is helpful:
https://www.millisecond.com/forums/FindPost13217.aspx


T
Thank you Dave for your tip.
What is wish to do is:
"once the trial starts, the subject is going to click "o" and then click as far as he/she can in the rectangle using mouse";
I wish to keep the mouse trajectory inside the grey rectangle while the mouse is moving. if the mouse moves outside, the trial restarts itself.
I guess the reference page tells "where to click" is considered as validresponse.
Thank you and hope this make senseWink



Dave
Dave
Supreme Being
Supreme Being (418K reputation)Supreme Being (418K reputation)Supreme Being (418K reputation)Supreme Being (418K reputation)Supreme Being (418K reputation)Supreme Being (418K reputation)Supreme Being (418K reputation)Supreme Being (418K reputation)Supreme Being (418K reputation)

Group: Administrators
Posts: 8.9K, Visits: 37K
Nakayama Yao - Wednesday, January 24, 2018
Dave - Wednesday, January 24, 2018
Nakayama Yao - Tuesday, January 23, 2018
Hi Inquisit 5 community,

I wish to track the current position of mouse after the mouse starts moving and before the rectangle is clicked, and once the mouse moves outside the rectangle, the trial resets.
Is there a syntax that allows to do this?
Thank you in advance.Wink

<trial tap>
/ ontrialend = [values.trialnum-=1]
/ ontrialbegin = [trial.tap.beginresponsetime = 0

/ ontrialend = [trial.tap.resetstimulusframes()]
/ validresponse = (mousemove)
/ stimulustimes = [0=screen,rectangle]
/ responseinterrupt = frames
/ inputdevice = mouse

</trial>

I'm not quite sure I 100% understand what you want to do, but perhaps this bit of code is helpful:
https://www.millisecond.com/forums/FindPost13217.aspx


T
Thank you Dave for your tip.
What is wish to do is:
"once the trial starts, the subject is going to click "o" and then click as far as he/she can in the rectangle using mouse";
I wish to keep the mouse trajectory inside the grey rectangle while the mouse is moving. if the mouse moves outside, the trial restarts itself.
I guess the reference page tells "where to click" is considered as validresponse.
Thank you and hope this make senseWink



Thanks. Then -- based on the code I linked to in my previous reply -- you could do something like this:

<expressions>
/ ismouseinrectangle = (mouse.x > 0.45*display.width && mouse.x <  0.55*display.width && mouse.y > 0.10*display.height && mouse.y < 0.90*display.height)
</expressions>

<block myblock>
/ trials = [1-4=sequence(clicktrial,mouseovertrial)]
</block>

<trial clicktrial>
/ stimulusframes = [1=rect, o]
/ inputdevice = mouse
/ validresponse = (o)
</trial>

<shape rect>
/ shape = rectangle
/ color = grey
/ position = (50%, 50%)
/ size = (10%, 80%)
/ erase = false
</shape>


<text o>
/ items = ("O")
/ position = (50%, 87%)
/ erase = false
/ txbgcolor = grey
</text>

<trial mouseovertrial>
/ posttrialpause = 500
/ stimulusframes = [1=rect]
/ inputdevice = mouse
/ validresponse = (mousemove)
/ isvalidresponse = [!expressions.ismouseinrectangle]
</trial>


Nakayama Yao
Nakayama Yao
Expert
Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)

Group: Forum Members
Posts: 39, Visits: 230
Dave - Wednesday, January 24, 2018
Nakayama Yao - Wednesday, January 24, 2018
Dave - Wednesday, January 24, 2018
Nakayama Yao - Tuesday, January 23, 2018
Hi Inquisit 5 community,

I wish to track the current position of mouse after the mouse starts moving and before the rectangle is clicked, and once the mouse moves outside the rectangle, the trial resets.
Is there a syntax that allows to do this?
Thank you in advance.Wink

<trial tap>
/ ontrialend = [values.trialnum-=1]
/ ontrialbegin = [trial.tap.beginresponsetime = 0

/ ontrialend = [trial.tap.resetstimulusframes()]
/ validresponse = (mousemove)
/ stimulustimes = [0=screen,rectangle]
/ responseinterrupt = frames
/ inputdevice = mouse

</trial>

I'm not quite sure I 100% understand what you want to do, but perhaps this bit of code is helpful:
https://www.millisecond.com/forums/FindPost13217.aspx


T
Thank you Dave for your tip.
What is wish to do is:
"once the trial starts, the subject is going to click "o" and then click as far as he/she can in the rectangle using mouse";
I wish to keep the mouse trajectory inside the grey rectangle while the mouse is moving. if the mouse moves outside, the trial restarts itself.
I guess the reference page tells "where to click" is considered as validresponse.
Thank you and hope this make senseWink



Thanks. Then -- based on the code I linked to in my previous reply -- you could do something like this:

<expressions>
/ ismouseinrectangle = (mouse.x > 0.45*display.width && mouse.x <  0.55*display.width && mouse.y > 0.10*display.height && mouse.y < 0.90*display.height)
</expressions>

<block myblock>
/ trials = [1-4=sequence(clicktrial,mouseovertrial)]
</block>

<trial clicktrial>
/ stimulusframes = [1=rect, o]
/ inputdevice = mouse
/ validresponse = (o)
</trial>

<shape rect>
/ shape = rectangle
/ color = grey
/ position = (50%, 50%)
/ size = (10%, 80%)
/ erase = false
</shape>


<text o>
/ items = ("O")
/ position = (50%, 87%)
/ erase = false
/ txbgcolor = grey
</text>

<trial mouseovertrial>
/ posttrialpause = 500
/ stimulusframes = [1=rect]
/ inputdevice = mouse
/ validresponse = (mousemove)
/ isvalidresponse = [!expressions.ismouseinrectangle]
</trial>


Thank you for this in-script, it is helpfulWink
may i ask another question regarding this: ?
<trial mouseovertrial>
/ posttrialpause = 500
/ stimulusframes = [1=rect]
/ inputdevice = mouse
/ validresponse = (mousemove)
/ isvalidresponse = [!expressions.ismouseinrectangle]
</trial>
The validresponse is coded as "the mouse moves inside the rect".
I wish to add another validresponse as "the rect is clicked" so the subject moves the mouse inside rect and finally clicks the rect.
I tried / validresponse = (mousemove, rect) or / validresponse = (rect) but nothing happen when the rect was clicked.
Thank you.



Dave
Dave
Supreme Being
Supreme Being (418K reputation)Supreme Being (418K reputation)Supreme Being (418K reputation)Supreme Being (418K reputation)Supreme Being (418K reputation)Supreme Being (418K reputation)Supreme Being (418K reputation)Supreme Being (418K reputation)Supreme Being (418K reputation)

Group: Administrators
Posts: 8.9K, Visits: 37K
Nakayama Yao - Wednesday, January 24, 2018
Dave - Wednesday, January 24, 2018
Nakayama Yao - Wednesday, January 24, 2018
Dave - Wednesday, January 24, 2018
Nakayama Yao - Tuesday, January 23, 2018
Hi Inquisit 5 community,

I wish to track the current position of mouse after the mouse starts moving and before the rectangle is clicked, and once the mouse moves outside the rectangle, the trial resets.
Is there a syntax that allows to do this?
Thank you in advance.Wink

<trial tap>
/ ontrialend = [values.trialnum-=1]
/ ontrialbegin = [trial.tap.beginresponsetime = 0

/ ontrialend = [trial.tap.resetstimulusframes()]
/ validresponse = (mousemove)
/ stimulustimes = [0=screen,rectangle]
/ responseinterrupt = frames
/ inputdevice = mouse

</trial>

I'm not quite sure I 100% understand what you want to do, but perhaps this bit of code is helpful:
https://www.millisecond.com/forums/FindPost13217.aspx


T
Thank you Dave for your tip.
What is wish to do is:
"once the trial starts, the subject is going to click "o" and then click as far as he/she can in the rectangle using mouse";
I wish to keep the mouse trajectory inside the grey rectangle while the mouse is moving. if the mouse moves outside, the trial restarts itself.
I guess the reference page tells "where to click" is considered as validresponse.
Thank you and hope this make senseWink



Thanks. Then -- based on the code I linked to in my previous reply -- you could do something like this:

<expressions>
/ ismouseinrectangle = (mouse.x > 0.45*display.width && mouse.x <  0.55*display.width && mouse.y > 0.10*display.height && mouse.y < 0.90*display.height)
</expressions>

<block myblock>
/ trials = [1-4=sequence(clicktrial,mouseovertrial)]
</block>

<trial clicktrial>
/ stimulusframes = [1=rect, o]
/ inputdevice = mouse
/ validresponse = (o)
</trial>

<shape rect>
/ shape = rectangle
/ color = grey
/ position = (50%, 50%)
/ size = (10%, 80%)
/ erase = false
</shape>


<text o>
/ items = ("O")
/ position = (50%, 87%)
/ erase = false
/ txbgcolor = grey
</text>

<trial mouseovertrial>
/ posttrialpause = 500
/ stimulusframes = [1=rect]
/ inputdevice = mouse
/ validresponse = (mousemove)
/ isvalidresponse = [!expressions.ismouseinrectangle]
</trial>


Thank you for this in-script, it is helpfulWink
may i ask another question regarding this: ?
<trial mouseovertrial>
/ posttrialpause = 500
/ stimulusframes = [1=rect]
/ inputdevice = mouse
/ validresponse = (mousemove)
/ isvalidresponse = [!expressions.ismouseinrectangle]
</trial>
The validresponse is coded as "the mouse moves inside the rect".
I wish to add another validresponse as "the rect is clicked" so the subject moves the mouse inside rect and finally clicks the rect.
I tried / validresponse = (mousemove, rect) or / validresponse = (rect) but nothing happen when the rect was clicked.
Thank you.



<expressions>
/ ismouseinrectangle = (mouse.x > 0.45*display.width && mouse.x <  0.55*display.width && mouse.y > 0.10*display.height && mouse.y < 0.90*display.height)
</expressions>

<block myblock>
/ trials = [1-4=sequence(clicktrial,mouseovertrial)]
</block>

<trial clicktrial>
/ stimulusframes = [1=rect, o]
/ inputdevice = mouse
/ validresponse = (o)
</trial>

<shape rect>
/ shape = rectangle
/ color = grey
/ position = (50%, 50%)
/ size = (10%, 80%)
/ erase = false
</shape>


<text o>
/ items = ("O")
/ position = (50%, 87%)
/ erase = false
/ txbgcolor = grey
</text>

<trial mouseovertrial>
/ posttrialpause = 500
/ stimulusframes = [1=rect]
/ inputdevice = mouse
/ isvalidresponse = [(expressions.ismouseinrectangle && trial.mouseovertrial.response == "rect") || !expressions.ismouseinrectangle]
</trial>


Nakayama Yao
Nakayama Yao
Expert
Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)Expert (1.3K reputation)

Group: Forum Members
Posts: 39, Visits: 230
Dave - Wednesday, January 24, 2018
Nakayama Yao - Wednesday, January 24, 2018
Dave - Wednesday, January 24, 2018
Nakayama Yao - Wednesday, January 24, 2018
Dave - Wednesday, January 24, 2018
Nakayama Yao - Tuesday, January 23, 2018
Hi Inquisit 5 community,

I wish to track the current position of mouse after the mouse starts moving and before the rectangle is clicked, and once the mouse moves outside the rectangle, the trial resets.
Is there a syntax that allows to do this?
Thank you in advance.Wink

<trial tap>
/ ontrialend = [values.trialnum-=1]
/ ontrialbegin = [trial.tap.beginresponsetime = 0

/ ontrialend = [trial.tap.resetstimulusframes()]
/ validresponse = (mousemove)
/ stimulustimes = [0=screen,rectangle]
/ responseinterrupt = frames
/ inputdevice = mouse

</trial>

I'm not quite sure I 100% understand what you want to do, but perhaps this bit of code is helpful:
https://www.millisecond.com/forums/FindPost13217.aspx


T
Thank you Dave for your tip.
What is wish to do is:
"once the trial starts, the subject is going to click "o" and then click as far as he/she can in the rectangle using mouse";
I wish to keep the mouse trajectory inside the grey rectangle while the mouse is moving. if the mouse moves outside, the trial restarts itself.
I guess the reference page tells "where to click" is considered as validresponse.
Thank you and hope this make senseWink



Thanks. Then -- based on the code I linked to in my previous reply -- you could do something like this:

<expressions>
/ ismouseinrectangle = (mouse.x > 0.45*display.width && mouse.x <  0.55*display.width && mouse.y > 0.10*display.height && mouse.y < 0.90*display.height)
</expressions>

<block myblock>
/ trials = [1-4=sequence(clicktrial,mouseovertrial)]
</block>

<trial clicktrial>
/ stimulusframes = [1=rect, o]
/ inputdevice = mouse
/ validresponse = (o)
</trial>

<shape rect>
/ shape = rectangle
/ color = grey
/ position = (50%, 50%)
/ size = (10%, 80%)
/ erase = false
</shape>


<text o>
/ items = ("O")
/ position = (50%, 87%)
/ erase = false
/ txbgcolor = grey
</text>

<trial mouseovertrial>
/ posttrialpause = 500
/ stimulusframes = [1=rect]
/ inputdevice = mouse
/ validresponse = (mousemove)
/ isvalidresponse = [!expressions.ismouseinrectangle]
</trial>


Thank you for this in-script, it is helpfulWink
may i ask another question regarding this: ?
<trial mouseovertrial>
/ posttrialpause = 500
/ stimulusframes = [1=rect]
/ inputdevice = mouse
/ validresponse = (mousemove)
/ isvalidresponse = [!expressions.ismouseinrectangle]
</trial>
The validresponse is coded as "the mouse moves inside the rect".
I wish to add another validresponse as "the rect is clicked" so the subject moves the mouse inside rect and finally clicks the rect.
I tried / validresponse = (mousemove, rect) or / validresponse = (rect) but nothing happen when the rect was clicked.
Thank you.



<expressions>
/ ismouseinrectangle = (mouse.x > 0.45*display.width && mouse.x <  0.55*display.width && mouse.y > 0.10*display.height && mouse.y < 0.90*display.height)
</expressions>

<block myblock>
/ trials = [1-4=sequence(clicktrial,mouseovertrial)]
</block>

<trial clicktrial>
/ stimulusframes = [1=rect, o]
/ inputdevice = mouse
/ validresponse = (o)
</trial>

<shape rect>
/ shape = rectangle
/ color = grey
/ position = (50%, 50%)
/ size = (10%, 80%)
/ erase = false
</shape>


<text o>
/ items = ("O")
/ position = (50%, 87%)
/ erase = false
/ txbgcolor = grey
</text>

<trial mouseovertrial>
/ posttrialpause = 500
/ stimulusframes = [1=rect]
/ inputdevice = mouse
/ isvalidresponse = [(expressions.ismouseinrectangle && trial.mouseovertrial.response == "rect") || !expressions.ismouseinrectangle]
</trial>


Many thanks, it works WinkWink
Best,

GO


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....






Millisecond Forums


Search