So I took a break from programming in macroscheduler as I was waiting for my server to arrive which will be running the program (a laptop with a smashed screen; $50 on ebay )
And I've run into a problem which makes me somewhat happy that I haven't yet purchased the software.
Sending key functions in a remote session on the host computer works fine, however using the mousemove command does absolutely nothing. Is there a work-around for this?
Mouse Move Through A Remote Session
Moderators: Dorian (MJT support), JRL
-
- Junior Coder
- Posts: 26
- Joined: Fri May 16, 2008 12:30 pm
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Actually the mousemove probably IS working, but the local cursor just isn't being updated. I've seen this in some remote environments. To demonstrate, try running this script:
If I'm right you'll see the dialog appear at the position that the remote cursor is in. Modify the first MouseMove accordingly.
So your scripts will still work fine. The remote cursor IS moving. But because it wasn't moved by the remote control software (i.e. it wasn't moved by YOU) your local cursor doesn't move.
Code: Select all
MouseMove>200,400
GetCursorPos>X,Y
Dialog>Dialog1
Caption=Dialog1
Width=224
Height=65
Top=%Y%
Left=%X%
Max=0
Min=0
Close=1
Resize=0
Edit=,0,0,121,
Edit=msEdit1,0,0,169,Cursor pos is %X%;%Y%
EndDialog>Dialog1
Show>Dialog1,r
So your scripts will still work fine. The remote cursor IS moving. But because it wasn't moved by the remote control software (i.e. it wasn't moved by YOU) your local cursor doesn't move.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Junior Coder
- Posts: 26
- Joined: Fri May 16, 2008 12:30 pm
Well, I have loops in my program which move to points on the screen.
ex:
Label>go1
FindImagePos>C:\macrolive\automate\donotword.bmp,SCREEN,0,0,XPos,YPos,NumFound
If>NumFound=0
Goto>go1
Endif
Let>XMove=XPos_0+20
Let>YMove=YPos_0+5
Label>go2
MouseMove>XMove,YMove
GetCursorPos>XC,YC
If>{(%XC%%XMove%) OR (%YC%go2
Endif
The program hangs in this loop, so I'm assuming that the mouse is never moved to the proper co-ordinates. I also don't see the mouse move...
ex:
Label>go1
FindImagePos>C:\macrolive\automate\donotword.bmp,SCREEN,0,0,XPos,YPos,NumFound
If>NumFound=0
Goto>go1
Endif
Let>XMove=XPos_0+20
Let>YMove=YPos_0+5
Label>go2
MouseMove>XMove,YMove
GetCursorPos>XC,YC
If>{(%XC%%XMove%) OR (%YC%go2
Endif
The program hangs in this loop, so I'm assuming that the mouse is never moved to the proper co-ordinates. I also don't see the mouse move...
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Would you humour me by running the script I posted and tell me what happens? I predict the dialog will appear at the MouseMove position thus proving the remote mouse is moving. Then we can look at why your script is stuck in a loop.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Junior Coder
- Posts: 26
- Joined: Fri May 16, 2008 12:30 pm
After finally having time to troubleshoot the problem, I've found that it isn't in fact the mouse which isn't moving but the needle image which isn't being found on the screen.
{Thanks for the test code Marcus}
The problem which occurs is that as soon as I minimize or exit the remote session any screenshots which are taken will just be taken as black. This seems to be a limitation with XP and not your software itself.
Please let me know if you know of a way to make this work. Thanks.
{Thanks for the test code Marcus}
The problem which occurs is that as soon as I minimize or exit the remote session any screenshots which are taken will just be taken as black. This seems to be a limitation with XP and not your software itself.
Please let me know if you know of a way to make this work. Thanks.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
When the session is minimized or exited the window station ceases to exist so there is no UI. The only solution is not to minimize or exit it. Leave it open. You can always make it very small and even move it off screen. But don't minimize or exit it. Minimizing a terminal services session does much the same as locking your desktop.
As you say, this is a "feature" of Windows. See:
http://www.mjtnet.com/msfaq171.htm
As you say, this is a "feature" of Windows. See:
http://www.mjtnet.com/msfaq171.htm
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Junior Coder
- Posts: 26
- Joined: Fri May 16, 2008 12:30 pm