How can I execute AutoHotKey in a game

Some games intercept keyboard and mouse events at a very low level, so they will get them before AutoHotKey. You should look for another solution for such games. Note also that using AutoHotKey can get you banned in some games.

One possibility would be to disable the primary monitor in Windows. This would avoid the cursor going into that monitor, keeping it all in the second monitor.

Two methods for doing that:

  • Use the keyboard shortcut Win+P and select "Second screen only".

  • Open Settings > Display, select the primary monitor and use the drop-down menu to select "Disconnect this display".

I have one small hesitation with my advice: I can't test because I don't have multiple monitors, so cannot be sure that Windows will let you disable the primary monitor.


You can use Dual Monitor Tools to restrict mouse movement.

I have used it in the past to restrict mouse movement in monitors. Some games dont have the ability to lock the mouse cursor to the playable area. This tool can fix that.