lock mouse movement only in game window

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
ManuGamer96_
Posts: 2
Joined: 22 Apr 2018, 09:00

lock mouse movement only in game window

22 Apr 2018, 09:37

Hi, I start by saying that I'm new in ahk.
I'm trying to turn the mouse movement into directional arrows on an acrive window for game multiboxing.
Actually i'm using a modified version of this script https://autohotkey.com/board/topic/4583 ... d-buttons/
Spoiler
My only problem is that the game window detect the mouse movements and pan the camera.
I need the window to not detect the mouse movement, but if i use MouseMove also ahk does not receive mouse movements.
Any advice? Thanks in advance for the help and sorry I do not know English very well.
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: lock mouse movement only in game window

22 Apr 2018, 11:14

its not very clear what u want, so here are my assumptions about the post you made and you correct them as you see fit

1. youre playing an fps game
2. youre using the script to translate mouse movement into keystrokes, ie mouse moves left, left arrow is sent
3. u wanna prevent the game from reacting to your mouse inputs
4. but ahk should keep reacting to mouse inputs and send keys accordingly
ManuGamer96_
Posts: 2
Joined: 22 Apr 2018, 09:00

Re: lock mouse movement only in game window

22 Apr 2018, 11:26

You understood perfectly, I apologize for not being enough clear on my first post.
User avatar
evilC
Posts: 4823
Joined: 27 Feb 2014, 12:30

Re: lock mouse movement only in game window

22 Apr 2018, 12:21

If swagfag's statements are true, you most likely cannot do this with MouseMove. 99% of FPS games do not pay *any* attention to the position of the cursor, they listen to the signals coming directly from the mouse.
In order to stop the game seeing the mouse move, you need either a Low-Level mouse hook, or something like Interception.
I do have code though that would let you completely stop windows from seeing the mouse moving, whilst still being able to read the mouse movement data, but you would not be able to use your existing code, because it works on the cursor.
To be honest, the technique used in that code you borrowed is pretty sucky.
I have a version that does not work on the position of the mouse cursor - see this thread, sample script 2.

If you are doing multi-boxing, you may also be interested in my AutoHotInterception project, which lets you use AHK code to read from keyboard and mice at a *per-device* level. ie you could have a 2nd keyboard or mouse for the 2nd game, and all your AHK scripts for the 2nd game only take their input from the 2nd keyboard or mouse.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 181 guests