InstallMouseHook vs Mousemove Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
potscrubber
Posts: 13
Joined: 09 Sep 2017, 01:51
Location: Aotearoa
Contact:

InstallMouseHook vs Mousemove

17 Feb 2019, 11:43

Hello Community

Wondering if anyone can shed light on my issue. In this usage case I have two different scripts active. Script 1 invokes #InstallMouseHook and a HotKey. If Script 1 is active, Script 2's operations with MouseMove are severly impeded. The "mouse moves" several factors slower if Script 1's #InstallMouseHook and Hotkey are active. Can anyone help me trouble-shoot the mechanism behind this?
Note 1: Script 2's MouseMove's take place within a BlockInput, On/Off segment of code.
Note 2: Both scripts are running with full elevation on Win10 Pro x64

Many thanks for any illuminations!
swagfag
Posts: 4141
Joined: 11 Jan 2017, 17:59

Re: InstallMouseHook vs Mousemove  Topic is solved

17 Feb 2019, 13:52

the reason
If a script other than the one executing SendInput has a low-level keyboard hook installed, SendInput automatically reverts to SendEvent (or SendPlay if SendMode InputThenPlay is in effect). This is done because the presence of an external hook disables all of SendInput's advantages, making it inferior to both SendPlay and SendEvent. However, since SendInput is unable to detect a low-level hook in programs other than [AutoHotkey v1.0.43+], it will not revert in these cases, making it less reliable than SendPlay/Event.
the solution SetMouseDelay -1
Helgef
Posts: 4479
Joined: 17 Jul 2016, 01:02
Contact:

Re: InstallMouseHook vs Mousemove

17 Feb 2019, 15:10

Or even, SetMouseDelay -1, -1. Additionally, if you didn't specify the speed for mousemove,you could add setdefaultmousespeed 0.

Cheers.

Edit: strike
Last edited by Helgef on 18 Feb 2019, 02:10, edited 1 time in total.
swagfag
Posts: 4141
Joined: 11 Jan 2017, 17:59

Re: InstallMouseHook vs Mousemove

17 Feb 2019, 18:22

i dont think SetMouseDelay -1, -1 would do anything different. the second arg has to be the string "Play", if at all present
potscrubber
Posts: 13
Joined: 09 Sep 2017, 01:51
Location: Aotearoa
Contact:

Re: InstallMouseHook vs Mousemove

20 Feb 2019, 03:43

HEY SWAGFAG & HELGEF

Thanks a lot for the information. You pointed me to a path that resulted in a happy resolution by doing a SendMode Event before each MouseMove (and back to SendMode Input after it) in Script 2. I must admit the SendMode's have been a very fuzzy area for me as I tend to use AHK mostly for an easy little app language rather than too much manipulation of other prog's. Anyway thanks again for the help and education.

Cheers

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], wineguy and 44 guests