Block all Input but Mouse Movement? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Flowgun
Posts: 74
Joined: 25 Aug 2022, 09:42

Block all Input but Mouse Movement?

Post by Flowgun » 25 Sep 2022, 16:02

Hello everyone,
the Subject says it all. Is there a way to block all input (keyboard and mouse clicks) but keep the mouse movement?

Having to block the mouse movement with the rest of the input makes my scripts feel more stuttery. If there's a way not to block the mouse, that would allow me also to place it where I want to click next while the scripts are doing their thing.

Rohwedder
Posts: 7555
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Block all Input but Mouse Movement?  Topic is solved

Post by Rohwedder » 26 Sep 2022, 02:16

Hallo,
try:

Code: Select all

BlockInput()
Return
q::
BlockInput := True
SoundBeep, 4000, 20
Sleep, 4000
BlockInput := False
SoundBeep, 1000, 20
Return

BlockInput()
{   #If BlockInput
    Hotkey, IF, BlockInput
    For all, LF in [[0x1FF,"sc{:X}"],[0xFF,"vk{:X}"]]
        Loop,% LF.1
            IF (""<Key:=GetKeyName(Format(LF.2, A_Index)))
                Hotkey, *%Key%, BlockInput
    BlockInput: 
    Return
}   #If
Press Q key and all inputs are blocked for 4 seconds.

Post Reply

Return to “Ask for Help (v1)”