Block input

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
akirofe
Posts: 176
Joined: 05 Apr 2021, 21:54

Block input

Post by akirofe » 25 Apr 2024, 19:10

Hi,

I'm trying to read this but can't understand everything quickly (explained in my signature thanks... :( )

https://www.autohotkey.com/docs/v1/lib/BlockInput.htm

Could you please help me with a codes to block AND unblock (mouse and keyboard inputs) with a key combination, say, <+F23 (I have F23 on my MMO mouse) thank you very much? :clap: :clap: :clap: :clap: :clap:
*** Thank you for reading. I am not in coding and know almost nothing about professional coding, hope for your patience and deeply appreciate any of your kind helps. My current interest in this awesome AHK is due to that my work is graphical ((architect/CAD) and, to reduce strains, my right hand is better off not leaving the mouse (an MMO mouse that has 12 side keys which I maps a lot of F keys and other keys in) as much as possible. All the best you lovely coders! ***

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

Re: Block input

Post by Rohwedder » 26 Apr 2024, 02:16

Hallo,
try (not tested with MMO mouse):

Code: Select all

#Requires AutoHotkey v1.1.33
+F23 Up::BlockInput,% (Block:=!Block)?"On":"Off"
or:

Code: Select all

#Requires AutoHotkey v2.0
+F23 Up:: {
	Static Block := False
	BlockInput (Block:=!Block)
}
Such a big mouse with 12 side keys should better be called a rat.

akirofe
Posts: 176
Joined: 05 Apr 2021, 21:54

Re: Block input

Post by akirofe » 28 Apr 2024, 23:26

Hi Rohwedder,

Long time no see dear Rohwedder. I hope you are well Rohwedder.

I don't know what I did wrong but it didn't seem to work - even when I changed to just F6 key to test... Please help me Rohwedder.

PS. Would you call an Azeron gamepad... a "cougar"... Rohwedder? :D
*** Thank you for reading. I am not in coding and know almost nothing about professional coding, hope for your patience and deeply appreciate any of your kind helps. My current interest in this awesome AHK is due to that my work is graphical ((architect/CAD) and, to reduce strains, my right hand is better off not leaving the mouse (an MMO mouse that has 12 side keys which I maps a lot of F keys and other keys in) as much as possible. All the best you lovely coders! ***

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

Re: Block input

Post by Rohwedder » 29 Apr 2024, 00:30

You must not have done anything wrong.
According to the manual, BlockInput On/Off sometimes does not work:
https://www.autohotkey.com/docs/v1/lib/BlockInput.htm#Remarks
https://www.autohotkey.com/docs/v2/lib/BlockInput.htm#Remarks
Note: The OnOff and SendMouse modes might have no effect if UAC is enabled or the script has not been run as administrator.

(This gamepad reminds me of a tiger's paw with extended claws.)

akirofe
Posts: 176
Joined: 05 Apr 2021, 21:54

Re: Block input

Post by akirofe » 29 Apr 2024, 01:42

Thank you very much Rohwedder! Yes you are right, I'm using company's pc... :(((
*** Thank you for reading. I am not in coding and know almost nothing about professional coding, hope for your patience and deeply appreciate any of your kind helps. My current interest in this awesome AHK is due to that my work is graphical ((architect/CAD) and, to reduce strains, my right hand is better off not leaving the mouse (an MMO mouse that has 12 side keys which I maps a lot of F keys and other keys in) as much as possible. All the best you lovely coders! ***

Post Reply

Return to “Ask for Help (v2)”