user button press
tiburona
tiburona at gmail.com
Thu Apr 8 21:05:15 UTC 2010
Thank you very much for your response, David. I actually managed to
figure out the correct code around the time you were responding. Here
it is for anyone in the future who might google this thread:
'Designate "theState" as the Default Slide State, which is the
'current, ActiveState on the Slide object "Stimulus"
Dim theState as SlideState
Set theState = Slide3.States("Default")
Dim next_mX as Long, next_mY as Long
Dim strHit As String
Dim theMouseResponseData As MouseResponseData
Do
'Was there a response?
If Slide3.InputMasks.Responses.Count > 0 Then
'Get the mouse response
Set theMouseResponseData =
CMouseResponseData(Slide3.InputMasks.Responses(1))
'Determine string name of SlideImage or SlideText object at
'mouse click coordinates. Assign that value to strHit
strHit = theState.HitTest(theMouseResponseData.CursorX,
theMouseResponseData.CursorY)
'Compare string name where mouse click occurred to CorrectAnswer
'attribute on each trial, and score response
'NOTE: This comparison is case sensitive
If strHit = "Image1" Then
GoTo Label2
End If
End If
Do Until (strHit = "Image1")
' capture & process further mouse clicks:
If (Mouse.Buttons And ebMouseButton1) Then
Mouse.GetCursorPos next_mX, next_mY
strHit = theState.HitTest( next_mX, next_mY )
End If
If strHit = "Image1" Then
GoTo Label2
End If
Loop
Loop Until (strHit = "Image1")
On Apr 8, 3:00 pm, David McFarlane <mcfar... at msu.edu> wrote:
> Katie,
>
> Stock reminder: 1) I do not work for PST. 2) PST's trained staff
> takes any and all questions athttp://support.pstnet.com/e%2Dprime/support/login.asp, and they
> strive to respond to all requests in 24-48 hours (although latest
> reports indicate more like 10 days) -- this is pretty much their
> substitute for proper documentation, so make full use of it. 3) If
> you do get an answer from PST Web Support, please extend the courtesy
> of posting their reply back here for the sake of others.
>
> That said, here is my take ...
>
> I can't go into full details, but here are a few hints that come to mind:
>
> 1) You will have to resort to inline code to do the Slide.HitTest.
>
> 2) I would probably use the main Slide to collect just the keyboard
> responses. I would use "extended input" (see Appendix C of the
> User's Guide that came with E-Prime) with a Duration of 0, increased
> MaxCount, EchoClient, etc. I would then follow the Slide with inline
> code to get the "Next" mouse click.
>
> 3) Unlike other input devices, you do not need an input mask to get
> mouse responses, see the MouseDevice topic in the online E-Basic
> Help. And because getting the "Next" might take several mouse
> clicks, I would get the mouse clicks directly (i.e., without an input
> mask) and use Slide.HitTest in a loop in inline code following the Slide.
>
> 4) In particular, your code
> Do Until (strHit = "Image1")
> Loop
> is an empty loop and will do nothing useful for you. You need to put
> the appropriate code inside that loop.
>
> Hope you find some help in that,
> -- David McFarlane, Professional Faultfinder
> "For a successful technology, reality must take precedence over
> public relations, for nature cannot be fooled." (Richard Feynman,
> Nobel prize-winning physicist)
>
> At 4/7/2010 09:23 PM Wednesday, you wrote:
>
> >Actually, reading this:
>
> >http://groups.google.com/group/e-prime/browse_thread/thread/ab5a03408...
>
> >made me realize I could perhaps pull the same trick, and put two
> >slides up in sequence, the first with 0 duration and infinite time
> >limit that would take the mouse click and then jump to a label after
> >both slides, the second with infinite duration and infinite time limit
> >that would have the image with my sentence and the EchoClient that
> >would allow the participant to time the response.
>
> >in fact, maybe this layering isn't even necessary. Maybe I can have
> >my keyboard EchoClient and my mouse button on the same SlideObject,
> >and just set the "Allowable" response on the mouse to the "next
> >button" Slide SubObject, and then choose terminate as the response.
>
> >I'm only writing this so I can spare anyone helpful enough to answer
> >me the trouble of outlining these elements of a solution in their
> >response.
>
> >(Incidentally, so far I am not having luck with the first method
> >because I can't figure out how to refer to my image file in the
> >"Allowable" box on the properties of the Mouse Input Mask. I tried
> >imitating another E Studio experiment someone else in my lab did, and
> >calling it [Target1] and then putting a Target1 attribute in the--I
> >don't know the terminology here--parent list (?) for the procedure but
> >it's giving me one of those "-999: Factor Error: Filename contains an
> >invalid attribute"s.)
>
> >On Apr 7, 6:45 pm, tiburona <tibur... at gmail.com> wrote:
> > > p.s. I would be overjoyed if someone could tell me how to do what I'm
> > > after without resorting to InLine, but I get the feeling that's not
> > > possible.
>
> > > On Apr 7, 6:41 pm, tiburona <tibur... at gmail.com> wrote:
>
> > > > Hi all,
>
> > > > My ultimate goal is to present words on a page for the participant to
> > > > respond to, either via image or text, collect text input from
> > > > participants that they see on screen in an EchoClient, and
> > > > simultaneously display a "Next" button that participants can use to
> > > > advance to the next portion of the experiment when they are done
> > > > typing. I've managed the first two elements fine, but getting E Prime
> > > > to terminate a screen in response to a button press is eluding me. I
> > > > am new to E-Prime and near-hopeless with E-Basic (even though I have a
> > > > little programming experience). I will probably eventually resort to
> > > > some subobtimal solution, like using the tab key to advance to the
> > > > next screen, because I'm skeptical I'll be able to get this running,
> > > > but I thought I would try an initial query to the group.
>
> > > > As a preliminary test, I set up a slide object (Slide2) with two
> > > > images (Image1 and Image2) on it.
>
> > > > I based this code on sample code from PST:
>
> > > > __________________________________________________
>
> > > > Dim theState as SlideState
> > > > Set theState = Slide2.States("Default")
>
> > > > Dim strHit As String
> > > > Dim theMouseResponseData As MouseResponseData
>
> > > > If Slide2.InputMasks.Responses.Count > 0 Then
>
> > > > Set theMouseResponseData =
> > > > CMouseResponseData(Slide2.InputMasks.Responses(1))
>
> > > > strHit = theState.HitTest(theMouseResponseData.CursorX,
> > > > theMouseResponseData.CursorY)
>
> > > > If strHit = "Image1" Then
> > > > Slide2.Stop
>
> > > > End If
>
> > > > Do Until (strHit = "Image1")
>
> > > > Loop
>
> > > > End If
>
> > > > _____________________________________________________________
>
> > > > I tried placing it before and after the slide object in a Procedure,
> > > > but it didn't work either way (still not sure which is right). I was
> > > > wondering if someone could help me understand why. I'm trying to
> > > > build up to what I'm actually attempting from smaller bits. I have
> > > > found other sample code related to what I'm trying to do (for
> > > > instance,
> > here:http://www.pstnet.com/forum/Topic4009-23-1.aspx?Highlight=HitTest)
> > > > but when I try to modify it it doesn't work either, so I figure maybe
> > > > if I start with a very simple unit I'd have a chance of building up
> > > > some understanding.
>
> > > > Thanks very much,
> > > > Katie
--
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.
For more options, visit this group at http://groups.google.com/group/e-prime?hl=en.
More information about the Eprime
mailing list