1

There are times when I need to disable my keyboard for a while to avoid unnecessary keystrokes which are quite likely to happen, like we can disable touch-pad of most laptop then enable it again.

I was wondering if there is a tool for which provides the functionality the same functionality for keyboards for Windows XP SP2.

4
  • I wonder what you could do or want to achieve...after disabling keyboard itself?
    – Misnomer
    Aug 5, 2010 at 22:07
  • Seconded. Does your cat like to tapdance on your keyboard when you're not home or something? Just lock the machine!
    – Shinrai
    Aug 6, 2010 at 14:36
  • no its more like reading documents / watching movies with a baby in the lap.... and yeah sometimes "Snowy" like to tap dance here Aug 6, 2010 at 16:31
  • Well that makes some more sense though. Still, I think the easiest solution would be 'push the keyboard back'. I hope you can figure this one out though, because I'm clueless.
    – Shinrai
    Aug 6, 2010 at 20:55

2 Answers 2

2

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.

2

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .