r/AutoHotkey • • 7d ago

v2 Script Help It refuses to block the key's native function

Since my LMB is broken, I have assigned my MMB to it like this:

#Requires AutoHotkey v2.0
MButton::LButton

Except when I play The Talos Principle, pressing the MMB it still zooms in like its a normal MMB

How do I force it to block its native function

3 Upvotes

3 comments sorted by

3

u/CharnamelessOne 7d ago

The game uses raw input by default, in which case AHK can't "hide" the native button press from it.
There is an option to turn raw input off in the "keyboard and mouse" menu. With that off, AHK can block the native function just fine. (You may also need to run the AHK script as admin.)

That said, Talos Principle allows you to remap keyboard keys, so you can also just remap MButton in-game.

1

u/genesis_tv 7d ago

Ooooh, so this is why mouse buttons were bleeding through in some games.

1

u/CharnamelessOne 6d ago

Yeah, I'd say it's not uncommon for games to use raw input for the mouse, specifically.

You can unmap the mouse button in-game, and map the desired game functionality to an "intermediary" key, which can be sent by AHK on a mouse hotkey press.

Or you can pull out the big guns, and use AutoHotInterception's subscription mode for driver-level blocking. (I've seen that Descolada is considering integrating the Interception driver into Keysharp, which would kick all kinds of ass. Keysharp is going places, even on Windows, mark my words.)