Mouse move with fullscreen game not working

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
dougluna
Posts: 1
Joined: 19 Mar 2017, 00:33

Mouse move with fullscreen game not working

27 Mar 2017, 12:38

Hello all,

I'm trying to make a script for a fullscreen game.

I want that when i start shooting (Lbutton pressed), it saves the mouse position so, when i release the Lbutton, my aim returns to that previous position.

First of all, I've tried to use MouseGetPos and MouseMove, it worked flawlessly at the Windows Explorer, but when I enter the fullscreen game, nothing happens, the mouse doesn't move.
My next move was to use Tooltip and I realized that the MousePosition doesn't change when i'm in the game.
Next, I tried to use MouseGetPos + DllCall("mouse_event", "UInt", 0x01, "UInt", StartX, "UInt", StartY). It has moved the mouse in the game, but not to the right place.

Any tips?

Thanks!
Noesis
Posts: 301
Joined: 26 Apr 2014, 07:57

Re: Mouse move with fullscreen game not working

28 Mar 2017, 01:00

As you've kind of discovered, many games don't use the mouse cursor position, instead they get the raw movement of the mouse (essentially the cursor is blocked while the window is active). You'll need to use something like AHK_HID library to read the mouse changes however before you do I suggest you test what happens when a mouse move is sent to the window, using relative movement so the mouse should move regarless of where it is, in theory. Reason being there is a pretty good chance that nothing will happen, which means you've got no way to send alterations to the mouse position anyway.

There is a way to work around this using a program called "Interception" but it requires installing a 3rd party driver and is kind of complex and I don't recommend it unless you're an experienced coder/scripter (it's very easy to block all input from your keyboard/mouse rendering your system non-responsive and forcing you to do a hard windows reboot to recover, if you're unsure about what your doing).

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Lamron750, Rohwedder and 275 guests