Reading mouse input alternatives to 'mousegetpos'

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
mikhail22
Posts: 19
Joined: 14 Jan 2018, 11:50

Reading mouse input alternatives to 'mousegetpos'

20 Oct 2021, 20:41

I suppose the answer is "no", but maybe I missed something on this topic, so is it possible
to somehow read the (relative) mouse movement other than just reading via 'mousegetpos'?

The problem with 'mousegetpos' is that it is bound to the screen and will obviosly stop changing
on the screen border, but I need to read the mouse input regardless of the screen cursor.
Also if I use 'Blockinput MouseMove' then it affects the 'mousegetpos' so again, I can't read
mouse input if I block the cursor movement. Is ther any way to overcome this limitation?
User avatar
SirSocks
Posts: 360
Joined: 26 Oct 2018, 08:14

Re: Reading mouse input alternatives to 'mousegetpos'

20 Oct 2021, 21:16

Did you try using a CoordMode statement?
This should detect mouse movement on the border of a screen. For example, If your mouse is at the very top of the screen, and you move it side to side, you'll have no change in the "y" value, but the "x" value should change.

Code: Select all

CoordMode, Mouse, Screen
MouseGetPos, OutputVarX, OutputVarY
User avatar
mikeyww
Posts: 26877
Joined: 09 Sep 2014, 18:38

Re: Reading mouse input alternatives to 'mousegetpos'

20 Oct 2021, 21:27

I believe that the question is how to read the device's output rather than the cursor position.
mikhail22
Posts: 19
Joined: 14 Jan 2018, 11:50

Re: Reading mouse input alternatives to 'mousegetpos'

20 Oct 2021, 21:44

mikeyww wrote:
20 Oct 2021, 21:27
I believe that the question is how to read the device's output rather than the cursor position.
Yes, exactly, I want to read the mouse input even if the cursor it is 'stuck' on the border of the screen.
And accordingly, I want to read the mouse input if I block the cursor with 'Blockinput' statement.
I suppose it is currently not possible, but maybe there are some ideas on this.
Maybe there is some some public Windows system variable that exposes this information.
I believe there should be some relative movement variable which is used by Windows to calculate the screen mouse cursor position.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Anput, arcylix, drani, Nerafius, Rohwedder and 220 guests