Block Keyboard Input Not Mouse

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
sonwon
Posts: 4
Joined: 12 Sep 2019, 16:42

Block Keyboard Input Not Mouse

13 Sep 2019, 03:23

I am trying to block the keyboard input but not the mouse input. Before anyone says it I am running the script with admin rights. I've tried,

BlockInput, On ; which blocks the keyboard and mouse

BlockInput, MouseMoveOff ; which doesn't block the keyboard

I have also tried the two together,

BlockInput, On
BlockInput, MouseMoveOff

which blocks the keyboard and mouse input.

Please point me in the right direction.

My problem is multiple key presses are overlapping within the script which causes issues. I may have the wrong approach to my problem?
Rohwedder
Posts: 7616
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Block Keyboard Input Not Mouse

13 Sep 2019, 04:31

Hallo,
try:

Code: Select all

Input, q
sonwon
Posts: 4
Joined: 12 Sep 2019, 16:42

Re: Block Keyboard Input Not Mouse

13 Sep 2019, 04:52

Wouldn't that pause the thread from continuing to execute?

What I want to do is block all threads until the current thread completes without blocking the mouse input.
sonwon
Posts: 4
Joined: 12 Sep 2019, 16:42

Re: Block Keyboard Input Not Mouse

13 Sep 2019, 08:43

I also tried,

Critical

same problem.
Rohwedder
Posts: 7616
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Block Keyboard Input Not Mouse

13 Sep 2019, 08:56

Hallo,
just run this

Code: Select all

Input, q
as a second script.

Code: Select all

^LButton::Gosub, KeyBoardOff
+LButton::Gosub, KeyBoardOn

KeyBoardOff:
IF KeyBoardOff
	Return
FileDelete, ~.ahk
FileAppend, #NoTrayIcon`nInput`, q, ~.ahk
Run, ~.ahk,,, KeyBoardOff
Return
KeyBoardOn:
Process, Close, %KeyBoardOff%
KeyBoardOff =
Return
sonwon
Posts: 4
Joined: 12 Sep 2019, 16:42

Re: Block Keyboard Input Not Mouse

13 Sep 2019, 11:52

Thank you for the reply. I was hoping for a built in solution. I guess I'll have to implement an if statement.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Descolada, Giresharu, Google [Bot], inseption86, jomaweb, Rohwedder and 264 guests