Detecting mouse clicks
David McFarlane
mcfarla9 at msu.edu
Tue Nov 15 15:34:44 UTC 2011
Just a few thoughts:
- Maybe your code does not reference the correct input mask (that's
the index number in, e.g., Task.InputMasks(1).Responses.Count -- see
the documentation the in E-Basic Help facility).
- Maybe EP *does* detect your mouse click, it's just that your code
does not then do anything that has a visible effect.
- 80% of the time, problems like this arise from the very design or
structure of the program, and when I get stuck, I start to back up
and rethink the entire design. Early on you went down a path that
used a lot of inline code; I would rethink that path, scrap the
existing program, and start over with another programming design
(perhaps along the lines that Mich & I both suggested earlier). Most
of the time I find that such a redesign or "refactoring" solves not
only the immediate problem but several others as well. Personally, I
am not afraid to throw away the first few attempts at a program
before I settle on a sound overall design, and even then I consider
everything tentative.
Good luck,
-- David McFarlane
At 11/15/2011 10:15 AM Tuesday, you wrote:
>I really appreciate your help, but I can't get it to function.
>
>The general setup is this: The subject is to complete 5 tasks
>(collected in a trial list): relaxing, listening to speech, reading,
>counting backwards, and listening to music. For each trial a 5 sec
>intro is made and then 3 minutes of performing the task.
>I've defined the attributes 'Visual' and 'Sound' (to control the text
>and sound) which are both objects in my slide named Task. For the
>reading I don't want any sound, but I want a piece of text to be
>displayed. When the subject has read the text (and 3 minutes have not
>passed) they should be able to 'turn the page' bu pressing the mouse.
>When 3 minutes have passed the task should end and the intro to the
>next presented. It all works, except for the reading.
>
>In my Task slide I have defined the input masks to be the mouse with
>{ANY} in the allowed response and (none) in End Action, under advanced
>I put Max Count to 99. Most of the tasks have a separate state in the
>slide, and the reading takes in the variable 'ReadText' to be
>displayed. The InLine script (placed before the slide Task) now looks
>like this:
>
>If c.GetAttrib("Visual") = "read" Then
> c.SetAttrib "ReadText", "Page 1"
>
> If Task.InputMasks(1).Responses.Count >0 Then
> c.SetAttrib "ReadText", "Page 2"
> End If
>
>End If
>
>
>When comming to the reading task the text "Page 1" is displayed, but
>no matter how hard I slam on the mouse, I cannot get the text to
>change to "Page 2".
>
>I have also tried with the following script (simply to try something):
>
>If c.GetAttrib("Visual") = "read" Then
>c.SetAttrib "ReadText", "Page 1"
>Task.InputMasks.Reset
>
> If Mouse.GetState() = ebStateOpen Then
> TaskEchoClients.RemoveAll
> Task.InputMasks.Add Mouse.CreateInputMask("{ANY}", "",
>CLng(Task.Duration), CLng("99"), ebEndResponseActionNone,
>CLogical("Yes"), "", "", "")
>
> If Task.InputMasks(1).Responses.Count >0 Then
> c.SetAttrib "ReadText", "Page 2"
> End If
> End If
>
>End If
>
>
>
>But with no luck... I cannot seem to understand that my pressing the
>mouse is not registered by E-Prime. How can it not !?!
--
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