Question about using a joystick in E-Prime

David McFarlane mcfarla9 at msu.edu
Tue Sep 4 20:52:14 UTC 2012


I still have never used a joystick in E-Prime, so I don't know how 
much help I can give.  You might also search this Google Group, and 
the PST User Forum, using the search term "joystick", for more 
discussion -- see, in particular, 
https://groups.google.com/d/topic/e-prime/qD0NwsXD7i4/discussion .

But as far as I understand, the joystick behaves much like a mouse 
(although EP2 now includes facilities specifically for joystick 
responses, which you might explore).  So, you might look at the 
"Track Mouse Coordinates" downloadable from the Samples area of the 
PST Product Service and Support site (requires registration & login) 
to see how to collect joystick coordinates.  I suspect you will have 
to use Inline code during a stimulus, and for that you will have to 
either set the stimulus Duration to 0, or use a sufficiently large 
PreRelease (e.g., same as Duration, which is already the new default 
since EP2.0.10.182).

Now, assuming you can compute a new size for the images based on the 
joystick coordinates, you might use Canvas drawing operations to 
redraw your images at the new size (see the Canvas topic in the 
E-Basic Help facility).  But personally, I like to do this sort of 
thing using Slide sub-objects, by first adjusting their Width and 
Height properties, and then using their Draw methods; e.g., 
SlideText.Draw to redraw a simple rectangle, or SlideImage.Draw to 
redraw an image.  If using a SlideImage, just set its Stretch 
property to True so that E-Prime will automatically redraw the image 
at the new size.  Oh, and you might have to first redraw the 
background when redrawing your figure at smaller size.

Yes, this might take a bit of careful inline programming, so get 
ready!  You might also submit a request to PST Web Support at 
http://support.pstnet.com/e%2Dprime/support/login.asp -- they strive 
to respond to all requests in 24-48 hours, and this is pretty much 
their substitute for proper documentation, so make full use of 
it.  And if you do get an answer from PST staff, please extend the 
courtesy of posting their reply back here for the sake of others.

-----
David McFarlane
E-Prime training 
online:  http://psychology.msu.edu/Workshops_Courses/eprime.aspx
Twitter:  @EPrimeMaster (twitter.com/EPrimeMaster)


At 9/4/2012 03:47 PM Tuesday, you wrote:
>I would like to record continuous joystick movement every 10ms for 2 
>to 3 seconds while study participants view images on a screen. At 
>the same time, I would like the images to increase or decrease in 
>size when participants pull or push, respectively, the joystick 
>lever. Would it be possible to accomplish this in E-Prime?

-- 
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 https://groups.google.com/groups/opt_out.



More information about the Eprime mailing list