Hi folks,
I have a recording module with an action "Mouse" -> "Move", as value I entered "50;50" which moves the mouse pointer to absolute screen coordinates x=50, y=50.
Works fine so far. What do I have to enter as value to move the mouse relatively (50 pixels to the left from the current position and 50 pixels to the top from the current position)?
moving mouse pointer relatively
moving mouse pointer relatively
System information:
I'm using Ranorex v9.6.3 on a Windows 10 machine.
I'm using Ranorex v9.6.3 on a Windows 10 machine.
Re: moving mouse pointer relatively
Hi, for the relative direction overall, you can use options like "UpperLeft", but from what i can see so far, they don't offer easy ways to control the magnitude. You may be able to work around that if you choose repository items for that Move action which you know are at the "right" distance.
Re: moving mouse pointer relatively
Hi,
if you convert a default mouse move action without item to usrecode , you can easily convert to your need.
I used code below to move mouse pointer to a certain position inside an element(adapter)
public void Mouse_Move_SomeCell(RepoItemInfo cellInfo)
{
Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Move item 'cellInfo' at 304;8.", cellInfo);
Ranorex.Cell mycell = cellInfo.FindAdapter<Cell>();
String mylocation = (mycell.ScreenRectangle.Width -2).ToString()+";"+(mycell.ScreenRectangle.Height-2).ToString();
Report.Log(ReportLevel.Info, "mylocation2", mylocation );
//Mouse.MoveTo(mylocation); // copied from mouse_move , us it to go anywhere on screen
mycell.DoubleClick(mylocation2);
}
Regards,
Don
if you convert a default mouse move action without item to usrecode , you can easily convert to your need.
I used code below to move mouse pointer to a certain position inside an element(adapter)
public void Mouse_Move_SomeCell(RepoItemInfo cellInfo)
{
Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Move item 'cellInfo' at 304;8.", cellInfo);
Ranorex.Cell mycell = cellInfo.FindAdapter<Cell>();
String mylocation = (mycell.ScreenRectangle.Width -2).ToString()+";"+(mycell.ScreenRectangle.Height-2).ToString();
Report.Log(ReportLevel.Info, "mylocation2", mylocation );
//Mouse.MoveTo(mylocation); // copied from mouse_move , us it to go anywhere on screen
mycell.DoubleClick(mylocation2);
}
Regards,
Don