Mouse responses

Tony Zuccolotto anthony.zuccolotto at pstnet.com
Tue Jul 15 13:01:32 UTC 2003


Dr. Mitchell,

Georg's summary is accurate, but there are some minor errors in the
script section that was listed.  The MouseDevice.Buttons property
returns a bitmask of which buttons are currently pressed.  You then need
to AND this with one of the ebMouseButtonX constants to check each bit.
Refer to the MouseDevice.Buttons property in the E-Basic Help for a
complete example but here is a short section of script that demonstrates
how to test the bits. 

If (Mouse.Buttons AND ebMouseButton1) Then
   Display.Canvas.Text 5, 100, "Left Mouse Button: PRESSED" 
Else
   Display.Canvas.Text 5, 100, "Left Mouse Button: NOT Pressed" 

End If

If (Mouse.Buttons AND ebMouseButton2) Then
	Display.Canvas.Text 5, 125, "Right Mouse Button: PRESSED" 
Else
	Display.Canvas.Text 5, 125, "Right Mouse Button: NOT Pressed" 
End If

Tony

*** DISCLAIMER: ALL VIEWS EXPRESSED ARE MY OWN AND DO NOT NECESSARILY
REFLECT THOSE OF PSYCHOLOGY SOFTWARE TOOLS *** 

Anthony P. Zuccolotto
Vice President
Psychology Software Tools, Inc.
2050 Ardmore Boulevard
Suite 200
Pittsburgh, PA 15221-4610
Phone     412-271-5040
FAX       412-271-7077
Email     anthony.zuccolotto at pstnet.com
Internet  http://www.pstnet.com


> -----Original Message-----
> From: Georg Odenthal [mailto:odenthal at soz.psychologie.uni-konstanz.de]
> Sent: Tuesday, July 15, 2003 7:05 AM
> To: Eprime mailing list
> Subject: Re: Mouse responses
> 
> Hello Dr. Mitchell,
> 
> > Could someone tell me how to enter a right and left click as
allowable
> > responses when using a mouse as input device to respond to stimuli?
> I've had this problem myself once and I couldn't find any
> documentation on that in the original E-Prime manuals.
> 
> Fortunately the mouse responses are not much different from what PST
> used in MEL2. That is the left mouse button is referred to as 1 and
> the right mouse button is 2 (the button in the middle, if you're
> using a three button mouse, is 3 as far as I know (in MEL2 it was 4,
> but that's a different matter)).
> 
> So if you want to record left and right mouse button presses just
> enter 12 in the allowable field in the Response Option field of any
> image display, text display, slide or text display field. Set the
> correct field (or the attribute you refer to in the correct field) to
> either 1 or 2 for the correct left or right mouse button press
> respectively.
> 
> If you intend to access the pressed mouse button from an InLine script
> use the following commands:
> 
> If (Mouse.Buttons) then
>         If (ebMouseButton1) Then
>                 debug.print "Left mouse button was pressed."
>         end if
>         If (ebMouseButton2) Then
>                 debug.print "Right mouse button was pressed."
>         end if
>         If (ebMouseButton3) Then
>                 debug.print "Middle mouse button was pressed."
>         end if
> end if
> 
> 
> 
> I hope this clarifies your question.
> 
> 
> Best regards,
>  Georg Odenthal
> 
> 
>
========================================================================
==
> 
> Georg Odenthal (Dipl.-Psych.)             University of Konstanz
> +49 (0)7531 88-2872                       Department of Psychology
> odenthal at soz.psychologie.uni-konstanz.de  Social Psychology and
Motivation
> http://www.socpsych.uni-konstanz.de       78457 Konstanz, Germany
> 
>
========================================================================
==
> 
> 



More information about the Eprime mailing list