MouseMove v1 vs. v2 (and Citrix workspace)
MouseMove v1 vs. v2 (and Citrix workspace)
I have finally transitioned my scripts to v2... but I am having an issue that has me stumped.
I have long used a timer triggered routine to wiggle the mouse to keep my screen from locking. [Note: Changing the screen timeout is not an option. The admins have that locked up.]
Under v1 (latest), this all worked great. Under v2 (latest), my Citrix session is not receiving/acknowledging/???? the mouse wiggle.
I thought I've already RTFM, but am I missing some change to the way MouseMove works? Any ideas to test?
I have long used a timer triggered routine to wiggle the mouse to keep my screen from locking. [Note: Changing the screen timeout is not an option. The admins have that locked up.]
Under v1 (latest), this all worked great. Under v2 (latest), my Citrix session is not receiving/acknowledging/???? the mouse wiggle.
I thought I've already RTFM, but am I missing some change to the way MouseMove works? Any ideas to test?
Re: MouseMove v1 vs. v2 (and Citrix workspace)
SendMode changes the way keys, mouse movement, and clicks are sent. In v1, Event mode is default. In v2, the default is Input. Try using SendMode("Event") to make MouseMove use event mode.
Re: MouseMove v1 vs. v2 (and Citrix workspace)
Thanks for the suggestion, ntepa. Unfortunately, this does not solve the problem.
I added a MouseClick hoping maybe it would truly be sent to the remote system... but that didn't work either.
Still scratching my head....
Re: MouseMove v1 vs. v2 (and Citrix workspace)
Try this. It sends a mouse move message every second. I only tested it with msedge.exe. You'll need to change to Citrix (I don't know the exe).
Code: Select all
SetTimer RandomMouseMove.Bind("ahk_exe msedge.exe"), 1000
RandomMouseMove(win) {
win := WinExist(win ?? "A")
WinGetPos(,, &Width, &Height, win)
x := Random(0, Width)
y := Random(0, Height)
lparam := x & 0xFFFF | (y & 0xFFFF) << 16
PostMessage 0x200, , lParam, win
}
Re: MouseMove v1 vs. v2 (and Citrix workspace)
Still no joy.
Re: MouseMove v1 vs. v2 (and Citrix workspace)
then post both script versions and we can check if something's different
Re: MouseMove v1 vs. v2 (and Citrix workspace)
@Lorien
Try to match the higher latencies/lower speed of the simulated mouse.
Because simulated input in v2 is a bit faster than in v1. This may be the solution to the problem.
Try to match the higher latencies/lower speed of the simulated mouse.
Because simulated input in v2 is a bit faster than in v1. This may be the solution to the problem.
Please post your script code inside [code] ... [/code] block. Thank you.
Re: MouseMove v1 vs. v2 (and Citrix workspace)
For anyone reading this and not knowing how to achieve it you can set the speed on the MouseMove command:
MouseMove X, Y , [Speed], Relative
0 is the fastest speed and 100 is the slowest. I would set it to 50 for starters.
Also you might want to try SendMode "Play"
Projects:
AHK-ToolKit
AHK-ToolKit
Re: MouseMove v1 vs. v2 (and Citrix workspace)
I tried the Speed param on MouseMove, and using Play mode. It did not fix the issue. Both versions of my code below for your amusement enjoyment.
AHK v1.1 code
AHK v1.1 code
Spoiler
AHK v2 code
Spoiler
Re: MouseMove v1 vs. v2 (and Citrix workspace)
Did you try different send modes?
There's event, input and play.
That last one usually plays ball when other modes don't work.
There's event, input and play.
That last one usually plays ball when other modes don't work.
Projects:
AHK-ToolKit
AHK-ToolKit
Re: MouseMove v1 vs. v2 (and Citrix workspace)
I have used every mode except "InputThenPlay." But not since slowing down the speed....
Part of me is suspicious that it has to do with focusing on (i.e. activating) the Citrix session window for input.
I have another module that works when triggered by a hotstring. I have been having trouble with an AHK Gui button that a) activates the previous window (using SKAN's wingetlistalt), then b) calls the same function as the hotstring to send keystrokes. (I'll have to test this idea... tomorrow.)
Re: MouseMove v1 vs. v2 (and Citrix workspace)
Lorien wrote: ↑20 Feb 2023, 10:06I have used every mode except "InputThenPlay." But not since slowing down the speed....
Part of me is suspicious that it has to do with focusing on (i.e. activating) the Citrix session window for input.
I have another module that works when triggered by a hotstring. I have been having trouble with an AHK Gui button that a) activates the previous window (using SKAN's wingetlistalt), then b) calls the same function as the hotstring to send keystrokes. (I'll have to test this idea... tomorrow.)
If you are not sure that the window might be active, then using ControlSend or ControlClick might be a better fit.
Those send the Events/Clicks to the control even if it is not active (your mileage might vary depending on the program though and the Send Mode).
A quick note on that, that method might not work if the window is minimized as the control might not actually 'exist'.
Projects:
AHK-ToolKit
AHK-ToolKit
Re: MouseMove v1 vs. v2 (and Citrix workspace)
Well... the focus issue was stupid. I was getting unwanted hwnds, so the focus was going to a different window (that didn't accept text input, so I couldn't see where it was going).
I've hardcoded the KeepAlive to activate the Citrix window before the MouseMoves... I'll see if that helps.
I've hardcoded the KeepAlive to activate the Citrix window before the MouseMoves... I'll see if that helps.
Re: MouseMove v1 vs. v2 (and Citrix workspace)
Turns out calling
Code: Select all
KeepAlive.On()
I'm to go crawl under a rock now.
Re: MouseMove v1 vs. v2 (and Citrix workspace)
why is it a bad thing?Lorien wrote: ↑23 Feb 2023, 12:23
Turns out callingevery minute is a bad thing. (i.e. resetting the timer)Code: Select all
KeepAlive.On()
I'm to go crawl under a rock now.
and do you think moving the mouse 2 pixels is enough for citrix to count it as a mouse move?
if you se the values higher can you see the mouse moving in the virtual machine?
Projects:
AHK-ToolKit
AHK-ToolKit