MouseMove with open folders fail Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
Evil-e
Posts: 146
Joined: 04 Sep 2018, 11:09

MouseMove with open folders fail

17 Jan 2020, 04:37

I have discovered probably one of the most brutal and horrifying events ever to bestow the computer user..... MouseMove fail :(

MouseMove works perfectly, as long as all folders are minimized. If a folder is opened, the mouse goes all haywire and I become overwhelmed with suicidal thoughts.

This is my basic script that works great until a folder(s) is open on Desktop

Code: Select all

BlockInput, On
SendMode, Event
MouseMove, 1600,1060,20
sleep, 100
SendMode, Event
MouseMove, 1845,1060,20
sleep, 50
SendMode, Event
MouseMove, 1000, 100
BlockInput, Off
Please help me to survive the tragedy of MouseMove fail. Is there something I can add to the script that ignores open folders?

:morebeard:
I have a bit of experience opening and sending commands to game console and CMD.exe... just ask :)
gregster
Posts: 4495
Joined: 30 Sep 2013, 06:48

Re: MouseMove with open folders fail  Topic is solved

17 Jan 2020, 04:50

It seems like you have no Coordmode command in your script that would tell it to use screen coordinates for MouseMove (like Coordmode Mouse, Screen), so by default:
https://www.autohotkey.com/docs/commands/MouseMove.htm#Parameters wrote:Coordinates are relative to the active window unless CoordMode was used to change that.
Which means, if you change the active (desktop) window to some other random window (like an open folder in a file explorer window), your coordinates most likely will be off.

Btw, it shouldn't be necessary to repeat SendMode, Event before each MouseMove.
User avatar
telanx
Posts: 68
Joined: 10 Jan 2020, 14:31

Re: MouseMove with open folders fail

17 Jan 2020, 05:04

Image

Code: Select all

CoordMode, Mouse, Screen    ; add this
sleep 1000
MouseMove, 100,260,20
sleep, 1000
MouseMove, 145,160,20
sleep, 1000
MouseMove, 10, 100
Evil-e
Posts: 146
Joined: 04 Sep 2018, 11:09

Re: MouseMove with open folders fail

17 Jan 2020, 08:09

@gregster and @telanx Thank you, that works perfectly :)
@gregster I have two sets of movements, as this is scripted to clear TaskBar cache. I have a bunch of games in which I use WideScreen fixer and several that I hot-swap between AHK.exe files during gameplay. On these games, there can sometimes be multiple cache icons down by the clock. Dragging the mouse over those icons, makes them vanish. At close of game and prior to ExitApp, this script moves the mouse to a position about 3" to the LH side of clock and then moves over TO the clock and clears all the icons* :)

I have tested the following and works like a charm, so now I need to track down all of the games that require this action and fix 'em :(

Code: Select all

BlockInput, On
CoordMode, Mouse, Screen
SendMode, Event
MouseMove, 1600,1060,20             ;places mouse about 3" to LH side of time display
sleep, 100
SendMode, Event
MouseMove, 1845,1060,20             ;moves mouse from above position to right next to time display       
sleep, 50
SendMode, Event
MouseMove, 1000, 100                ;relocates the mouse back to center of Desktop for convenience
BlockInput, Off
*ya... I had a bit of time on my hands :crazy:

:morebeard:
I have a bit of experience opening and sending commands to game console and CMD.exe... just ask :)

Return to “Ask For Help”

Who is online

Users browsing this forum: azik0244, felipe93, marqqer, Robbl and 65 guests