Hey
I'm looking for an alternative to Blockinput mousemove, as it's not completely blocking user mouse movement while "MouseMove" is in progress.
The normal Blockinput is safer, but it also causes some keys to get stuck if released while it's on, so I'm looking for an alternative that will stop only the mouse.
Any help will be appreciated
Blockinput Alternative
-
- Posts: 296
- Joined: 07 Nov 2020, 08:37
Re: Blockinput Alternative
It's blocking mouse move completely there, and I'm looking for something that will allow it and only prevent input
Re: Blockinput Alternative
Hi.
In the help about MouseMove (https://lexikos.github.io/v2/docs/commands/MouseMove.htm#Remarks) there is the possibility of a DllCall call that does work with the function created by Rohwedder, in viewtopic.php?f=76&t=107272, I imagine that it has to be an equivalent to clicking.
In the script I have put two keyboard shortcuts to lock and unlock, and another to move the mouse to a position, and it works even if the mouse is locked.
In the help about MouseMove (https://lexikos.github.io/v2/docs/commands/MouseMove.htm#Remarks) there is the possibility of a DllCall call that does work with the function created by Rohwedder, in viewtopic.php?f=76&t=107272, I imagine that it has to be an equivalent to clicking.
In the script I have put two keyboard shortcuts to lock and unlock, and another to move the mouse to a position, and it works even if the mouse is locked.
Code: Select all
^F3::
BlockInputMouse(True)
Return
^F6::
BlockInputMouse(False)
Return
^F9::
DllCall("SetCursorPos", "int", 100, "int", 400)
Return
BlockInputMouse(Block)
{ Static hHookMouse
IF Block And !hHookMouse
hHookMouse := SetWindowsHookEx(WH_MOUSE_LL := 14, RegisterCallback("True"))
Else IF !Block And hHookMouse
UnhookWindowsHookEx(hHookMouse), hHookMouse := False
}True() {
Return, True
}SetWindowsHookEx(idHook, pfn) {
Return DllCall("SetWindowsHookEx", "int", idHook, "Uint"
, pfn, "Uint", DllCall("GetModuleHandle", "Str"), "Uint", 0)
}UnhookWindowsHookEx(hHook) {
Return DllCall("UnhookWindowsHookEx", "Uint", hHook)
}
-
- Posts: 296
- Joined: 07 Nov 2020, 08:37
Re: Blockinput Alternative
I'm using a relative mousemove, how can I do that with that DLL function?
Re: Blockinput Alternative
I do not know much. That is why I make scripts based on such knowledge. You can use WinGetPos to find out the position and size of the current window (which I assume is why you use relative mouse position), while also finding out the size of the monitor, and you have to figure out how to do the calculation of the relative position of the window.
I'm sure someone who knows more than me will give you an easier solution.
I'm sure someone who knows more than me will give you an easier solution.