Do..While for mouse click
Corona
shunyata.aishwarya at gmail.com
Tue Sep 25 14:21:28 UTC 2012
Hi everyone,
I managed to find a solution to my problem, having rummaged through several
of the posts here. I am still facing some problems however. My modified
code is as below:
Do
If (Mouse.Buttons And ebMouseButton1) Then
Mouse.GetCursorPos x, y
strHit2 = theFeedbackState.HitTest(x,y)
'strHit2 = "checkagain"
'Debug.print "Point" & theFeedbackState.HitTest(x,y)
ptCurrentfb.x = x
ptCurrentfb.y = y
if PointInRect(ptCurrentfb, FeedbackDest) then
strHit2 = "correct"
'theSoundOut.Stop
'exit do
'cnvs.clear
Debug.print "Correct"
else
Debug.print "Checking again"
strHit2 = "checkagain"
end if
'Debug.print "strHit2aft" & strHit2
End If
Loop until strHit2 = "correct"
This code works (lets call it the intermediate stage) - in the sense that
if the participant were to click on any other area (apart from the
designated area) nothing happens. I am however having trouble with
resetting the ebMouseButton1 for the trials (say" stage 3) that follow.
What happens is - in stage 3, if one were to click on the specific
designated area (even though the canvas corresponding to this region was
cleared at the end of the intermediate stage) - it simply moves onto the
next trial (say stage 4) without going to the intermeditate stage again.
Thus, the actual flow of the task is: Stage 2 - Intermediate stage (problem
here!) - stage 3 - intermediate stage - stage 4 - ....so on..
On using debug.print, I find that the ebMouseButton1 button is never reset,
and so based on a previous correct click, this stage becomes "automatic"
and immediately moves to stage 3. That is, to the end user, the first time
there is Stage 2 - Intermediate stage (problem here!) - stage 3 - stage 4.
Please let me know if there is anything that can be done to rectify this. I
have tried to explain as clearly as I can, but if anything needs more
clarification please let me know.
I would genuinely appreciate any help.
Thanks a ton,
Corona
On Monday, September 24, 2012 3:34:08 PM UTC-4, Corona wrote:
>
> I am trying to execute the following do..until statements in the context
> of a dot probe task. The loop below basically checks whether the
> participant clicked on a designated area(a cnvs rectangle copied to the
> destination marked as "FeedbackDest"). Assuming the participant does not
> click on this region, no action is taken. One can get out of the loop only
> by hitting the designated spot. There is a music that precedes this
> statement, and basically, when one hits a prompt, a music follows, and the
> participant is directed to this region to click (basically to proceed with
> a fresh trial). Once the participant clicks on this region, the music
> stops.
>
> While I get this to work for a participant who answers correctly (i.e.
> clicks on the correct/designated area), when one clicks on a different area
> of the screen - the music continues to play (as it should), but right after
> that, if I were to click on the designated spot - nothing happens (ideally,
> it should proceed to the next set of images).
>
>
> If confirmation_flag = 1 then
> If Not theSoundOut Is Nothing Then
> theSoundOut.Play
> 'Manipulate the SlideSoundOut properties and methods
> 'Debug.Print theSoundOut.Filename
> nResponseCount2 = 0
> Do
> If mouseMask2.Responses.Count > nResponseCount2 then
>
> nResponseCount2 = nResponseCount2 + 1
> Set theMouseResponseData2 =
> CMouseResponseData(mouseMask2.Responses(nResponseCount2))
> strHit2 =
> theFeedbackState.HitTest(theMouseResponseData2.CursorX,theMouseResponseData2.CursorY)
> ptCurrentfb.x = theMouseResponseData2.CursorX
> ptCurrentfb.y = theMouseResponseData2.CursorY
> if PointInRect(ptCurrentfb, FeedbackDest) then
> strHit2 = "Correct"
> 'exit Do
> else
> strHit2 = "checkagain"
> end if
> End if
> Debug.print "strHit2" & strHit2
> Loop until strHit2 = "Correct"
> If Not theSoundOut Is Nothing Then
> theSoundOut.Stop
> Set theSoundOut = Nothing
> End if
> End if
>
> End if
>
> Please let me know where I am going wrong.
>
--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To post to this group, send email to e-prime at googlegroups.com.
To unsubscribe from this group, send email to e-prime+unsubscribe at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/e-prime/-/iyozVNN3b80J.
For more options, visit https://groups.google.com/groups/opt_out.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.linguistlist.org/pipermail/eprime/attachments/20120925/1dc35505/attachment.htm>
More information about the Eprime
mailing list