暂时禁用键盘


1

有时候我需要暂时禁用键盘以避免不必要的键击,这很可能会发生,比如我们可以禁用大多数笔记本电脑的触摸板,然后重新启用它。

我想知道是否有一个工具为Windows XP SP2的键盘提供相同功能的功能。


我想知道在禁用键盘本身后你能做什么或想要实现什么?
Misnomer 2010年

借调。当你不在家或什么的时候,你的猫喜欢在你的键盘上敲击吗?只需锁定机器!
Shinrai 2010年

没有更像是在膝盖上阅读文件/看电影......有时候“Snowy”喜欢在这里踢舞
Junaid Saeed 2010年

那么这会更有意义。不过,我认为最简单的解决方案是“推回键盘”。我希望你能想出这个,因为我很无能为力。
Shinrai 2010年

Answers:


2

是的,AutoIt当然可以做到这一点。你需要什么来触发开/关选项?您是否只想阻止键盘或所有类型的输入?

一个简单的例子:

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

Sleep(5000) ;sleep for 5 seconds

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

或者更复杂,但可能更符合您的目标:

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

参考上面的内容,您需要为每个不做任何操作的键执行热键操作,并将其设置为DoNothing函数。


2

也许像AutoIt或AutoHotkey这样的脚本工具可以“吃掉”所有按键,直到按下某个热键。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.