Detecting mouse clicks

David McFarlane mcfarla9 at msu.edu
Tue Nov 15 15:06:08 UTC 2011


ELine,

I am with Mich's suggestion 2 -- Just use a 
TextDisplay or Slide plus an ordinary Mouse input 
mask, no inline code needed.  I never understand 
why so many people immediately jump to using 
complex inline code instead of just using the 
capabilities already built in to the E-Prime objects.

-- David McFarlane


At 11/15/2011 06:03 AM Tuesday, you wrote:
>Hi,
>Three things:
>- I find Task.InputMasks(1).Responses.Count more 
>appropriate, since .InputMasks is a collection 
>(sometimes of 1). It turns out, however, that 
>E-Prime has no problems with that (I assume this 
>is VB's lazy tolerance, resulting in having a 
>hard time learning other languages).
>- *It does not work*. What, E-Prime fails to 
>show your Task slide? Or, the text is not 
>updated? Is Task an 'unreferenced object' 
>(called in inline)? Do you actually do something 
>like Task.Run (otherwise I see no way of showing 
>"Page 1 of the book"). I find calling 
>unreferenced objects in this way not always as 
>easy as all that, with inputmasks not responding 
>and such. I'm sure somebody else can help better 
>at that aspect - personally, I tend to go for 
>referenced objects again, saving code and making 
>the experiment more transparent. Or, finally, do you get some run-time error?
>- Why do you want to refer to 
>"Task.InputMasks.Responses.Count" if you merely 
>want to go to the next slide? Here's what I'd do:
>1. A list with one attribute, "myPageContent", 
>with, on level 1 "Page 1 of the book" and on 
>level 2 "Page 2 of the book". Sequential 
>selection, one procedure. Exit list, after 180000 (3 minutes).
>In the procedure
>2. A textdisplay showing the text 
>[myPageContent]. One input object (just in the 
>properties, no messing with inline needed), 
>mouse, allowable {ANY}, duration 60000 (or something).
>
>Done, mouse click proceeds to next page, no code 
>necessary. Obviously, you could with minimal 
>code get it to work so that left mouseclick goes 
>one page back and right mouseclick proceeds.
>Hope that helps,
>Mich
>
>
>Dr. Michiel M. Sovijärvi-Spapé
>Research Fellow
>Perception & Action group
>University of Nottingham
>School of Psychology
>www.cognitology.eu
>
>
>-----Original Message-----
>From: e-prime at googlegroups.com 
>[mailto:e-prime at googlegroups.com] On Behalf Of ELine
>Sent: 15 November 2011 10:39
>To: E-Prime
>Subject: Detecting mouse clicks
>
>Hi,
>
>I have a problem with a very straight-forward piece of code that I
>hope you can help me with.
>The task is simply to detect a mouse click (in no particular place on
>the screen) in order to change the displayed text. Essentially I want
>to have the subject to page through a book using the mouse for 3
>minutes and then proceed to the next trial. As far as I reckon the
>InLine should look something like this:
>
>Task.Text= "Page 1 of the book"
>
>If  Task.InputMasks.Responses.Count = 1 Then
>    Task.Text= "Page 2 of the book"
>End If
>
>But it doesn't work!! I've tried add a line creating an inputmask
>(Task.InputMasks.Add Mouse.CreateInputMask), but matter what I do I
>cant get a response.
>
>Does it have something to do with where I place the InLine (before
>Task) and what type of object Task is (I've tried with both
>TextDisplay and Slide).
>
>I hope to hear from you.
>ELine

-- 
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