mousemove


Author
Message
Nakayama Yao
Nakayama Yao
Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K 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.;)

<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 (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
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.;)

<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
Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K 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.;)

<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 sense;)



Dave
Dave
Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
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.;)

<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 sense;)



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
Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K 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.;)

<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 sense;)



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 helpful;)
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 (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)Supreme Being (1M reputation)
Group: Administrators
Posts: 12K, Visits: 98K
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.;)

<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 sense;)



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 helpful;)
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
Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K reputation)Distinguished Member (4.1K 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.;)

<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 sense;)



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 helpful;)
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 ;);)
Best,

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Reading This Topic

Explore
Messages
Mentions
Search