This article applies to:
This item has been introduced in E-Prime 2.0 (Alpha 1).
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
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
|can this been used in e-prime 1.1?|
|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
' 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
|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
-- David McFarlane, Professional Faultfinder
|Yes, Mouse.GetCursorPos px, py and Mouse.GetCursorPos pt as shown would be effectively equiv statements |