<< Click to Display Table of Contents >> Navigation: 3. Script Language > Mouse-Operations > Direct Engine > Direct Engine Mouse-Operations |
MiniRobotLanguage (MRL)
MAP. Command
Move active point (direct engine)
Intention
To understand this command, you need to know the term "Active Point".
What is the "Active Point"?
The "active Point" is the "Focus Point" of the robot. It is the point "On screen", where the next robot action will happen.
How do i set the "active point"?
Normally you locate a button, window or object. These are all rectangular areas. The robot will set the "active point" to the point in the middle of these rectangular areas.
Can i influence the "active point" in any way?
This is where MAP. enters the game. Using MAP. you can set or move the "active point".
MAP. is somehow ike MPO. with the option "x".
But even if the "x" is not specified, MAP. will set the Active Point and NOT move the Mouse.
MAP. does only move the "active Point", it does not move the mouse cursor.
The most important usage is to move the AP relative to where its right now.
Relative moves do not count from 0,0, but from where the AP is. This way, you can locate a button and then move the AP 10 pixel to the right from the button center.
Here is an example-script:
STW.ct|PBWindowClass:0|TestApp
' We locate Button 2
SCW.nct|2|Button|Button 2
' We move the AP from the button center 100 points to the left
MAP.p|-100,0
' We move the Mouse to the AP
MMV.
' We move the AP from the current position 200 points to the right
MAP.p|200
MMV.
' Move the AP 100 up, and 100 left
MAP.p|-100,-100
MMV.
' Move AP for 100 points down, we are back in the button center!
MAP.p|0,100
MMV.
ENR.
The next thing that is often used, is a "window relative coordinate". It counts from the upper left corner of the actually located button/Top- or Child-window.
The advantage over screen coordinates is, that these coordinates move with the window, if the window moves. The Editor will sometimes record "window local coordinates".
Here is an example:
STW.ct|PBWindowClass:0|TestApp
SCW.nct|2|Button|Button 2
MAP.w|10,10
MLC.
ENR.
Note that you can use Formulas in (..) as parameters:
STW.ct|PBWindowClass:0|TestApp
SCW.nct|2|Button|Button 2
VAR.$$NUM=5
MLC.p|(15*$$NUM),(-23*$$NUM)
Syntax
MAP.[P1|][P2,P3]
Parameter Explanation
P1 - (optional) prototype coordinates
Prototype can be omitted or any of:
GROUP I (based on rectangular Area) Prototypes
"w" - choose RECT from last located Window (Child-/ or Top-Window)
"t" - choose RECT from last located Top-Window
"k" - choose RECT from last located Child-Window
"a" - choose RECT from last located Accessible Object (E8) (using SAO.,AGR.,NAV. etc.)
"g" - choose RECT from last located graphical Object (E9) (using QFR,, ANA., UNI. etc.)
"o" - choose RECT from last located Object/Window (any sort of)
"s" - use Screen-Coordinates, these will go over the whole Screen, including Dual- or Multi-Monitors
for these "Base-Prototypes" you can specify additionally fine-tuning using:
- Quadrant coordinates like:
MMV.o|{A2-B4}
- numeric numbers (positive and negative)
MMV.o|-20,90
and you can combine this:
MMV.o|-20,90 {A2-B4}
also there are three Prototypes that will do sort of "left-right" or "Mid" Positioning. These 3 can not be combined with each other.
"d" - Sort of LBO. - Positioning on the Left side of the current Rectangle.
"e" - Sort of RBO. - Positioning on the Right side of the current Rectangle.
"r" - Midpoint of the last RECT (default)
' Example (Combination):
MMV.oe|-20,90 {A2-B4}
GROUP II (based on Point) Prototypes
"m" - actual mouse-position. Usefull if the user moves the mouse somewhere and you want to act on that position.
"b" - last mouse-position, before last Move.
"p" - current "Active Point". (Default)
"l" - Last "Active Point".
If prototype is omitted, Screen-Coordinates are taken.
P2, P3 - (optional) x,y - coordinates
numeric coordinates, separated by comma. You can use
variable and Formula in (..). You can also use a
Point-Variable instead of two coordinates.
Important:
In case you use MAP. without any Parameter, then MAP. will try to get the TOS-Content (Top of Stack). If it is a Single Point, like
100,200
then MAP. will locate that point (as Screen coordinates). In case on the Stack is a RECT, like this: 100,200,150,400
then the Middle-Point of that RECT (in Screen coordinates) is been calculated and located as actual point.
This way you can more easily use MAP. together with GRM. and GAR. commands. And immediately Move the Mouse there.
STW.ct|MyClassName|Sample Application
GAR.
GRM.
MAP.
MMV.
ENR.
Example
'***********************************
' MMV./MAP. - Sample
'***********************************
' Please start the Testapp
'
STW.ct|PBWindowClass:0|TestApp
SCW.nct|2|Button|Button 2
MAP.p|-100
MMV.
MAP.p|200
MMV.
MAP.p|-100,-100
MMV.
MAP.p|0,100
MMV.
ENR.
Remarks
This Command has been changed.
Limitations:
-
See also:
• 1.C Direct Engine and Compatible Engine
• MLE. - Mouse-Left-Click Event
• MLM - Mouse Left click Move (Invinsible)
• MLI - Mouse Left Click quIckly (Invinsible)
• MRC. / MRI. - Mouse-Right-Click