Temporarily Disable Keyboard

Yes, AutoIt can certainly do this. What do you need to trigger the on/off option? Do you only want to block the keyboard, or all types of input?

A simple example:

BlockInput(1) ;Disable all user input (mouse and keyboard)

Sleep(5000) ;sleep for 5 seconds

BlockInput(0) ;enable all user input (mouse and keyboard)

Or more complex, but probably more to what you are looking to do:

HotKeySet("d", "DoNothing") ;sets d key to function DoNothing
HotKeySet("{ESC}", "Terminate") ;sets ESC key to function Terminate

While 1 ;while loop to keep processor from maxing out
    Sleep(100)
WEnd

Func DoNothing() ;does nothing when d key is pressed

EndFunc

Func Terminate() ;exits out when ESC key is pressed
    Exit 0
EndFunc

In reference to the above, you will need to do a hotkey for every key you want to do nothing and just set it to the function DoNothing.


Perhaps a scripting tool like AutoIt or AutoHotkey can "eat" all keystrokes until a certain hotkey is pressed.