2015-01-06 83 views
-2

有没有办法禁用按住按键的功能? 我不是指粘滞键,它增加了最小时间延迟,因为我想要按键立即行动,而不是等我释放键。如何禁用键盘上的“按住”按键

本质上我希望keydown事件被keydown + keyup所取代。

我正在使用的应用程序没有注册按钮,直到键被释放。

有关示例打字时:QW

  • 我按下Q下
  • 然后我按W下来
  • 将我释放Q
  • 然后松开W¯¯

这使得QW被罚款。

但在这个应用我使用,直到第一个被释放,因此只会其注册为Q.

感谢

编辑它不会注册的第二个按键: 我结束了写一个AutoIt脚本:(数字+特殊键注释掉)

#include <MsgBoxConstants.au3> 

HotKeySet("a", "HotKeyPressed") 
HotKeySet("b", "HotKeyPressed") 
HotKeySet("c", "HotKeyPressed") 
HotKeySet("d", "HotKeyPressed") 
HotKeySet("e", "HotKeyPressed") 
HotKeySet("f", "HotKeyPressed") 
HotKeySet("g", "HotKeyPressed") 
HotKeySet("h", "HotKeyPressed") 
HotKeySet("i", "HotKeyPressed") 
HotKeySet("j", "HotKeyPressed") 
HotKeySet("k", "HotKeyPressed") 
HotKeySet("l", "HotKeyPressed") 
HotKeySet("m", "HotKeyPressed") 
HotKeySet("n", "HotKeyPressed") 
HotKeySet("o", "HotKeyPressed") 
HotKeySet("p", "HotKeyPressed") 
HotKeySet("q", "HotKeyPressed") 
HotKeySet("r", "HotKeyPressed") 
HotKeySet("s", "HotKeyPressed") 
HotKeySet("t", "HotKeyPressed") 
HotKeySet("u", "HotKeyPressed") 
HotKeySet("v", "HotKeyPressed") 
HotKeySet("w", "HotKeyPressed") 
HotKeySet("x", "HotKeyPressed") 
HotKeySet("y", "HotKeyPressed") 
HotKeySet("z", "HotKeyPressed") 

;HotKeySet("1", "HotKeyPressed") 
;HotKeySet("2", "HotKeyPressed") 
;HotKeySet("3", "HotKeyPressed") 
;HotKeySet("4", "HotKeyPressed") 
;HotKeySet("5", "HotKeyPressed") 
;HotKeySet("6", "HotKeyPressed") 
;HotKeySet("7", "HotKeyPressed") 
;HotKeySet("8", "HotKeyPressed") 
;HotKeySet("9", "HotKeyPressed") 
;HotKeySet("0", "HotKeyPressed") 

;; Special characters 
;HotKeySet("{{}", "HotKeyPressed") 
;HotKeySet("{}}", "HotKeyPressed") 
;HotKeySet("{TAB}", "HotKeyPressed") 
;HotKeySet(";", "HotKeyPressed") 
;HotKeySet("'", "HotKeyPressed") 
;HotKeySet("#", "HotKeyPressed") 
;HotKeySet(",", "HotKeyPressed") 
;HotKeySet(".", "HotKeyPressed") 
;HotKeySet("/", "HotKeyPressed") 
;HotKeySet("\", "HotKeyPressed") 
;HotKeySet("", "HotKeyPressed") 

;HotKeySet("+!d", "HotKeyPressed") ; Shift-Alt-d 

While 1 
    ; 
WEnd 

Func HotKeyPressed() 
    ; Unset the HotKey 
    HotKeySet(@HotKeyPressed) 
    ; Send the keys 
    Send(@HotKeyPressed) 
    Sleep(10) 
    HotKeySet(@HotKeyPressed, "HotKeyPressed") 
EndFunc ;==>HotKeyPressed 
+0

你确定这是因为[键盘鬼影]不是(http://www.microsoft.com/appliedsciences/antighostingexplained.mspx)? –

+0

Re“我正在使用的应用程序在按键被释放前没有按下按钮,”我们没有权力改变甚至没有命名的软件。 – ikegami

+0

@DavidReeve它实际上是AW,但我只是在问题中使用了QW。而且我知道AW不会鬼。 – EoinH

回答

0

_WinAPI_SetWindowsHookEx会做你要找的内容(在事件函数,你必须确定数据存在,但它是很容易) 。

或者可能利用[HotString] [1]。

除了我在道德问题上无法做到的事情之外,无法真正看到任何合理的理由来捕捉“每个”键(上或下或组合)。

还有这个例子:

[1]: http://www.autoitscript.com/forum/topic/68422-hotstrings-string-hotkeys 
+0

非常感谢! – EoinH