Mouse Behavior - Suspend and ShowCursor

509 views
Skip to first unread message

PHILLIP M Mahoney

unread,
Oct 20, 2016, 4:14:19 PM10/20/16
to E-Prime
Hi All,

I'm seeing some counter-intuitive mouse behavior in my experiment and I was wondering if anyone has any thoughts or suggestions. In the instructions section, I have 1 blank slide followed by an InLine that uses the Canvas method to display text, show bitmaps, play sound files, clear the canvas, and do it all over again. To move on, participants click any mouse button, after being told to do so. I am using Mouse.Suspend and .Resume to prevent them from just clicking through without reading. That all works fine, but the mouse cursor is just floating there on the screen, and I can't seem to find a way to get rid of it.

Some things to note:

1. First, it seems as though the cursor is appearing AS A RESULT of Mouse.Suspend. Mouse.Resume actually makes it go away. (There is a certain sense to this, of course--I assume that suspending mouse functioning in e-prime restores the default setting of the PC--but it is far from convenient).

2. In Edit>Experiment>Devices>Mouse, I have Show Cursor set to No.

3. Mouse.ShowCursor False does not work in combination with Mouse.Suspend, so far as I can tell.

In summary, Mouse.ShowCursor by itself gets rid of the cursor, but allows participants to click before being directed to, while Mouse.Suspend gives me control over responses, but saddles me with a useless cursor.

My guess is that Mouse.Suspend is causing unnecessary problems, despite being the most intuitive solution. Should I try using Clock.Read, or some other method, to turn mouse responses on and off, instead?  

I hope I didn't miss the answer to this in a previous thread.

Any thoughts would be greatly appreciated.

Phil

David McFarlane

unread,
Oct 25, 2016, 1:14:10 PM10/25/16
to e-p...@googlegroups.com
Phil,

First & foremost, you should *not* use Device.Suspend (e.g.,
Mouse.Suspend) unless you have a *deep* understanding of how E-Prime
handles devices. Suspend does not do what you think it does (as
evidenced by your discoveries).

I don't know why you would want to suspend the mouse and then run code
expressly designed to look at mouse clicks. Instead, just write your
inline code so that it does not look at mouse clicks in the first place
during the relevant time period. This seems more intuitive to me. What
am I missing?

-- David McFarlane

PHILLIP M Mahoney

unread,
Oct 25, 2016, 2:25:37 PM10/25/16
to e-p...@googlegroups.com
Hi David,
Thanks for taking the time to respond to what is starting to look like a silly question. I guess what you're missing is the degree of my ignorance. From what you say, it sounds like I went wrong by setting the mouse as an input device on the Slide, which therefore necessitates turning it off until I need it. I gather, then, that there is some way to do this strictly in the InLine. If anyone could even shout out a helpful keyword to plug into Basic Help, that would probably give me a good push in the right direction.
Also, I will heed your warning regarding Suspend.
Thanks again,
Phil 

--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe@googlegroups.com.
To post to this group, send email to e-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/e-prime/580F92DE.2060404%40msu.edu.

For more options, visit https://groups.google.com/d/optout.



--
Phillip Mahoney, Ph.D.
pmah...@temple.edu

David McFarlane

unread,
Oct 25, 2016, 4:18:04 PM10/25/16
to e-p...@googlegroups.com
Phil,

Hmm, my first question then would be, how is your program supposed to
know when the subject is done reading? First, they are supposed to
click any mouse button in order to move on after they are done reading
the instructions. But then you don't want to allow mouse clicks until
they are done reading. Either a mouse click means they are done
reading, or it doesn't, and then something else means that they are done
reading. First we would have to nail down the specifications of what
you want to do, and then think through how to implement it. I think
once you have the task design clear, the implementation will also become
clear.

Best,
-- David McFarlane

PHILLIP M Mahoney

unread,
Oct 25, 2016, 6:53:41 PM10/25/16
to e-p...@googlegroups.com
David,
Thanks again for your reply. Maybe if I explain it in more detail, you can help me pick out the major weak spot(s).
 
The test I'm designing is an adaptive gap detection test for use with so-called naive participants, so the instructions have to be extremely simple and didactic.

Here is how it goes:
The instructions come through text that is also read out loud. That means that a sound file loads, then a line of text comes up on the screen, which is read out loud by a narrator, then another line of text appears and is read, then an example picture appears, etc., etc. The sound file is essentially continuous and is synced up with the text using gaps in the audio and Sleep. At the conclusion of what I'll call each instructional segment, a "Click the mouse to continue" message comes up. Here, I use a Do While Response.Count = Loop. This allows the participant to review any of the text before moving on. When they click the mouse, the canvas clears and the next instructional segment begins with a new narration file loading and new lines of text, pictures, etc. This all moves along quite organically and seamlessly, if I don't say so myself--and is ultimately bonehead proof--even if the coding leaves something to be desired.

As it is now, I use the Suspend function so that mouse clicks are not logged until the Do While Loop appears. If I don't do something to disallow those clicks, the screen will clear as soon as we hit the Do While Loop, because it will be looking for a response count...which, in turn, means the participant won't have a chance to decide whether they get it before moving on. 

We've agreed that Suspend is not the way to go. Possibly the Response.Count method is too all-purpose for what I'm trying to do, as well.  

I hope that is clear and I look forward to your advice, should you be so kind as to delve into my personal can of worms.

Best,
Phil

  

--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe@googlegroups.com.
To post to this group, send email to e-p...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

David McFarlane

unread,
Oct 27, 2016, 10:59:20 AM10/27/16
to e-p...@googlegroups.com
Phil,

OK, first I will set out how I understand your design, make sure that I
get this right:

The program starts playback of a sound file that recites some
instructions. At several prearranged times during the playback, lines
of text appear (unclear if each new line replaces the existing text, or
is added to it so that the text accumulates, but that makes no real
difference). At the end of sound playback and the final text segment,
the program waits for the subject to click any mouse button, and then
proceeds. Then the process starts over again with the next
instructional segment. Etc.

Here is how I would do this:

I would start the sound playback with a SoundOut or Slide +
SlideSoundOut. I would set the sound Stop After to "No", and End Action
to "(none)", and set the Duration to the time until the first text
segment. I would *not* use any input mask here, that will come later.

Next I would use a TextDisplay or Slide to present the first text
segment, with its Duration set to the time until the second text
segment. And so on. You see where this is going ... I would just use
a succession of TextDisplays or Slides, each to present another text
segment, with Duration set for the time until the next text segment, all
coordinated with the sound file.

Finally, for the TextDisplay or Slide with the final text segment, I
would set Duration to "(infinite)", and add an input mask for the mouse
with End Action set to "Terminate". That will take care of waiting for
the subject to click the mouse to continue.

Does this sound straightforward? Note that I do all of this with *no*
inline code whatsoever. The inline code that you developed may indeed
be very slick, and I commend you for that nice bit of work, but really
sometimes dropping into inline code rather defeats the purpose of
E-Prime, and I think that applies here.

To make this a little more slick, I would probably use a List to present
the successive instructional segments. So my instructional Procedure
would present just one instructional segment (sound + text segments),
and for each instructional segment the List would supply attributes for
the sound file to play, the text to present for each text segment, and
the Duration of each stimulus object. All with no inline code. Follow?

Well, the List idea would work well as long as each instructional
segment has the same number of text segments, otherwise things could get
a little messier and you might need to apply some finesse with inline
code for that.

That all said, there are some simple mouse commands that would allow you
to make your existing inline code work. But I hesitate to reveal that,
because I really think that you ought to discard your lovely inline code
and rebuild your program in a proper E-Prime way.

Best,
-- David McFarlane

PHILLIP M Mahoney

unread,
Oct 27, 2016, 2:21:04 PM10/27/16
to e-p...@googlegroups.com
Thanks once again, David, for sticking it out with me. Just a few minor corrections/responses to what you wrote.

The narration doubles the text (not sure if that came through in my previous description), so that everything that is spoken is also written. The text appears one sentence at a time and accumulates up to about 4 sentences. The number of sentences is not constant, because it is largely determined by conceptual chunk, or topic. Once the participant has imbibed one of these little chunks, they are asked to click before moving on. That is the major difference in our descriptions, but I don't know how much that matters.

A simplified slide/segment looks like this, with the rows accumulating sequentially:

                                                             Load SoundOut1                               
Text: "Sometimes the gap will be big."      [narrator reads aloud]
Picture: waveform with a big gap              [sound of white noise with a  big gap]
Text: "Sometimes the gap will be small."   [narrator reads aloud]
Picture: waveform with small gap              [sound of white noise with a small gap]
Text: Click the mouse to continue.             [narrator reads aloud]

[[Participant clicks, canvas clears.]]
                                                              Load SoundIOut2
Text:                                                       [narration]
Picture:                                                   [sound]
Text:                                                        [narration]
Picture:                                                    [sound]
Text: Click the mouse to continue.              [narration]  

There are about 6 of these segments and some other bits in between.

I appreciate the advice to do this with SlideObjects and that is pretty much how I began, but I found that I was needing more and more slides to get the control that I wanted. Even to get the instructions to appear one sentence at a time, I need an inline, or many many slides, because I don't want to just hit the participant with a big block of text all at once. So, I think what looks like the more streamlined approach actually ends up being very bulky and inefficient.

Hadn't considered the List idea. I like it, but I'm not sure it's for this one.

What was it you said about simple mouse commands? You have sufficiently piqued my curiosity.

Best,
Phil
  


--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe@googlegroups.com.
To post to this group, send email to e-p...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

David McFarlane

unread,
Oct 27, 2016, 4:53:05 PM10/27/16
to e-p...@googlegroups.com
Phil,

So let's say you have 6 instructional segments, and each of those has on
average 6 sub-segments of text or picture. That means in the worst case
you need about 36 stimulus objects to present each sub-segment
individually (without getting clever and using a List to consolidate
some of these). Clumsy, but quite doable. I don't see how resorting to
inline code makes this any better. You can definitely present your text
one sentence at a time, just put one sentence at a time into a Slide or
TextDisplay. You could even present your text one word or letter at a
time, just look at how other people do RSVP with E-Prime.

If I could not figure out how to make one master Procedure that worked
with each of the instructional segments, then I would make one
InstructionProc that held all 36 or so sub-segment in sequence. Then I
would use a main List that called my InstructionProc and then my
experiment Procedures, etc. This is a common way to do this.

Maybe I just need to see your complete instructional sequence. Maybe
you are just doing something at an unusual scale. Several of my users
do instructions with text & sound and they have no problem, but they
don't do it at quite the scale that you indicate here.

Best,
-- David McFarlane
>> email to e-prime+u...@googlegroups.com.

PHILLIP M Mahoney

unread,
Oct 27, 2016, 5:20:41 PM10/27/16
to e-p...@googlegroups.com
David,
Yes, I think somewhere around 40 to 50 slides would probably do it. But this would be an extensive redesign just to get rid of a dangling cursor. Perhaps that's what it will take.
As always, thanks so much for your help. I'm looking forward to trying the List idea somewhere.
Best,
Phil
 


To post to this group, send email to e-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/ms
gid/e-prime/58121636.9060409%40msu.edu.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe@googlegroups.com.

To post to this group, send email to e-p...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

David McFarlane

unread,
Oct 27, 2016, 8:30:09 PM10/27/16
to e-p...@googlegroups.com
Phil,

I just had another wacky thought. If each of your 6 instructional
sequences really is that complicated, with coordinated sequences of
sound, text, and images, then why not just package each one up into a
movie file? Then just have E-Prime play the 6 movie files, and at the
end of each movie file just use a Slide, TextDisplay, Wait, or
whatever to get the mouse click. Easy-peasy! Unless I am still
missing something.

Best,
-- David McFarlane
>>>> email to e-prime+u...@googlegroups.com.
>>>> To post to this group, send email to e-p...@googlegroups.com.
>>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>>> gid/e-prime/58121636.9060409%40msu.edu.
>>>>
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "E-Prime" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to e-prime+u...@googlegroups.com.
>> To post to this group, send email to e-p...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/e-prime/5812692D.1010607%40msu.edu.
>>
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> --
> Phillip Mahoney, Ph.D.
> pmah...@temple.edu
>
> --
> You received this message because you are subscribed to the Google Groups
> "E-Prime" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to e-prime+u...@googlegroups.com.
> To post to this group, send email to e-p...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/e-prime/CA%2Bp4epNaw%3DXzC9kg6ndDyq24tnZufA6XCEdkeYXFoQt71g9waw%40mail.gmail.com.

PHILLIP M Mahoney

unread,
Oct 27, 2016, 9:37:17 PM10/27/16
to e-p...@googlegroups.com
That is a really great idea! Why didn't I think of it?! That could be a really elegant solution. Sometimes it's hard to see the woods for the trees, I guess. 
Best,
Phil 


>>>> To post to this group, send email to e-p...@googlegroups.com.
>>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>>> gid/e-prime/58121636.9060409%40msu.edu.
>>>>
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "E-Prime" group.
>> To unsubscribe from this group and stop receiving emails from it, send an

>> To post to this group, send email to e-p...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/e-prime/5812692D.1010607%40msu.edu.
>>
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> --
> Phillip Mahoney, Ph.D.
> pmah...@temple.edu
>
> --
> You received this message because you are subscribed to the Google Groups
> "E-Prime" group.
> To unsubscribe from this group and stop receiving emails from it, send an

> To post to this group, send email to e-p...@googlegroups.com.
> To view this discussion on the web visit
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe@googlegroups.com.

To post to this group, send email to e-p...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

PHILLIP M Mahoney

unread,
Nov 1, 2016, 2:46:37 PM11/1/16
to e-p...@googlegroups.com
Just to follow up on this thread, for anyone who arrives here in the future...

I am going to take the advice to create 6 movies, but I did find a simple code solution to the problem that does away with Suspend.

As the instructions are unfolding, the participant can click as much as they want. When you want to "allow" their response, you simply set all the responses so far equal to some variable (x) that you've defined as an integer.
Then, write a Do While...Loop that waits until the response number is greater than that variable. So, responses are still collected, but they remain inactive until you want them.
 
It looks like this:

Dim X As Integer
Mouse.ShowCursor False

cnvs.Text 560, 1000, "Click the mouse to continue."

X = Slide1.InputMasks.Responses.Count

Do While Slide1.InputMasks.Responses.Count = X
Loop

If Slide2.InputMasks.Responses.Count > X Then
    cnvs.Clear
    Sleep 500
End If

Now that I've done it, it is embarrassingly obvious, but maybe there are other poor fools like me out there who will benefit from my errors.

Phil



David McFarlane

unread,
Nov 1, 2016, 4:43:40 PM11/1/16
to e-p...@googlegroups.com
Phil,

Thanks for your followup, showing how to wait for a mouse click in
inline code using an existing input mask. I'll add that you might also
just poll the mouse device directly, e.g.,

Do Until (Mouse.Buttons = 0) ' first make sure no buttons pressed
Loop
Do Until Mouse.Buttons ' wait for mouse click
Loop
' ... continue program ...

See the MouseDevice topic in the E-Basic Help facility. This method, of
course, does not itself collect any response data, but sometimes this is
all that you want.

One other possibility, when your code gets to the point where it should
wait for a mouse click, exit the code and use a normal stimulus object
(Wait, etc.) to get the mouse click, then loop back to the inline code, etc.

Several ways to skin this cat, depending on your exact requirements and
tastes.

Best,
-- David McFarlane


Appendix

The following will also work:

Do While Mouse.Buttons ' first make sure no buttons pressed
Loop
Do Until Mouse.Buttons ' wait for mouse click
Loop
' ... continue program ...

Etc. You get the idea.
>>>>>>> email to e-prime+u...@googlegroups.com.
>>>>>>> To post to this group, send email to e-p...@googlegroups.com.
>>>>>>> To view this discussion on the web visit
>>> https://groups.google.com/d/ms
>>>>>>> gid/e-prime/58121636.9060409%40msu.edu.
>>>>>>>
>>>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>> Groups
>>>>> "E-Prime" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an
>>>>> email to e-prime+u...@googlegroups.com.
>>>>> To post to this group, send email to e-p...@googlegroups.com.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/e-prime/5812692D.1010607%40msu.edu.
>>>>>
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Phillip Mahoney, Ph.D.
>>>> pmah...@temple.edu
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>> Groups
>>>> "E-Prime" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an
>>>> email to e-prime+u...@googlegroups.com.
>>>> To post to this group, send email to e-p...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/e-prime/CA%2Bp4epNaw%3DXzC
>>> 9kg6ndDyq24tnZufA6XCEdkeYXFoQt71g9waw%40mail.gmail.com.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "E-Prime" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an
>>> email to e-prime+u...@googlegroups.com.
>>> To post to this group, send email to e-p...@googlegroups.com.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/e-prime/CABwcpZ4baXwYybzaRS2%2BVJ73TQSBET%3DrAr9XAitUP6n
>>> 7dw6s_Q%40mail.gmail.com.

PHILLIP M Mahoney

unread,
Nov 1, 2016, 4:57:54 PM11/1/16
to e-p...@googlegroups.com
David,
Yes, I had been messing around with .Buttons, but was getting an error message: "Buttons is not an assignable property of the object." There must have been something wrong with my syntax, because what you gave me works fine.
Best and thanks,
Phil


To post to this group, send email to e-p...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/ms
gid/e-prime/58121636.9060409%40msu.edu.

For more options, visit https://groups.google.com/d/optout.





--
You received this message because you are subscribed to the Google
Groups
"E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send
an

To post to this group, send email to e-p...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/e-prime/5812692D.1010607%40msu.edu.

For more options, visit https://groups.google.com/d/optout.




--
Phillip Mahoney, Ph.D.
pmah...@temple.edu

--
You received this message because you are subscribed to the Google
Groups
"E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send
an

To post to this group, send email to e-p...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/e-prime/CA%2Bp4epNaw%3DXzC
9kg6ndDyq24tnZufA6XCEdkeYXFoQt71g9waw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups
"E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an

To post to this group, send email to e-p...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/ms
gid/e-prime/CABwcpZ4baXwYybzaRS2%2BVJ73TQSBET%3DrAr9XAitUP6n
7dw6s_Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.




--
Phillip Mahoney, Ph.D.
pmah...@temple.edu

--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe@googlegroups.com.

To post to this group, send email to e-p...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages