<< Click to Display Table of Contents >> Navigation: 3. Script Language > Mouse-Operations > Compatible Engine > Compatible Engine Mouse-Operations |
MiniRobotLanguage (MRL)
GMP. Command
Get Mouse Position
Intention
Returns the position of the Mouse-Pointer or of the internal "Actual Point" which is not equal.
Depending on the used prototypes the command gives the coordinates in screen or window relative.
P1 is mostly two letter. First specify if you want the Mousepointer-Position or the "actual point".
Example:
GMP.mw|$$RET
or if you specify "k" then this command requires two variables for holding the resulting x and y data.
GMP.mwk|$$REX,§§REY
In case you want the "actual point" instead of the "Mouse pointer position", just use the "a" directive instead of the "m".
Syntax
GMP.P1|P2[,P3]
Parameter Explanation
P1
These are the source-prototypes
a - get "actual point" in Screencoords if no "c" or "t" Option is used
m - get mouse-position
If whether "a" nor "m" is specified, "m" is the default.
the following prototypes define the coordinate system being used for the result:
s - screen coordinates (default)
t - get point in actual Top-window coordinates
c - get point in actual window coordinates
w - last (whatever) window-coordinates
Additional you can specify
r - client coordinates of the selected window
k - output to 2 variables instead of one
P2 - Variable for result or if "k" is used, for result #1, the x-coordinate
P3 - Variable for result #2, the y-coordinate
Example
'***********************************
' Example 1
' with 2 data variables for result
'***********************************
' Get Mousepointer
GMP.km|§§XPO,§§YPO
PRT. Mouse is at: §§XPO,§§YPO
DMP.
:over
MBX.Halt to read output
END.
'***********************************
' Example 2
'***********************************
' Get Mousepointer
GMP.§§MPO
PRT. Mouse is at: §§MPO
DMP.
END.
Remarks
-
Limitations:
-
See also:
• MPO. - Mouse-POsition move