This article applies to:
E-Prime 3.0
E-Prime 2.0
This item has been introduced in E-Prime 2.0 (Alpha 1).
Detail
This feature provides for a second method of retrieving the current position of the mouse's coordinates using a Point type.
' Example code
Dim thePoint as Point
Mouse.GetCursorPos thePoint
Debug.Print "Mouse is at location: " & thePoint.X & " " & thePoint.Y
For more information view the E-Prime Command Reference for specifics involving E-Basic (https://pstnet.com/ecr).
Legacy End User Comments
Dandan Pang 2/16/2011 8:21 | can this been used in e-prime 1.1? |
Brandon Cernicky 2/16/2011 9:50 | No, this is new to E-Prime 2.0. However, in both E-Prime 1.x and E-Prime 2.x, you can continue to use integer values for this function. ' integer parameters can be used in EP1 and EP2 Dim x As Long Dim y As Long Mouse.GetCursorPos x, y ' a Point structure can be used in EP2 and later (not EP1) Dim pt As Point Mouse.GetCursorPos pt ' If you are collecting responses from duration/input ' the most accurate position of the mouse at click ' time is to use a response data If Stimulus.InputMasks.Responses.Count > 0 Then Dim theMouseResponseData As MouseResponseData Set theMouseResponseData = CMouseResponseData(Stimulus.InputMasks.Responses(1)) If Not theMouseResponseData Is Nothing Then Debug.Print theMouseResponseData.CursorX Debug.Print theMouseResponseData.CursorY End If End If |
David McFarlane 2/20/2012 23:12 | So to clarify, does this mean that in EP2 and later the argument to Mouse.GetCursorPos is overloaded, so that we may use either one argument of type Point, or a pair of arguments of type Integer or Long? E.g, in EP2 and later the following code should be valid: Dim px as Long, py as Long Dim pt as Point Mouse.GetCursorPos px, py Mouse.GetCursorPos pt ? -- David McFarlane, Professional Faultfinder |
Brandon Cernicky 2/29/2012 15:03 | Yes, Mouse.GetCursorPos px, py and Mouse.GetCursorPos pt as shown would be effectively equiv statements |
Comments
0 comments
Please sign in to leave a comment.