循环判断 如果鼠标右击,则鼠标左击空白处取消,如何实现?
本帖最后由 chase_100 于 2012-11-29 11:18 编辑搜索到论坛中屏蔽鼠标右键的方法,感觉效果不太理想,我想通过循环判断当电脑使用者右键点击后,紧跟着在右键菜单外的地方左键点击一次或两次来将出现的右键取消;请各位前辈指教。 本帖最后由 annybaby 于 2012-11-24 23:08 编辑
#include <Misc.au3>
HotKeySet('^`','_exit')
$dll = DllOpen("user32.dll")
While 1
Sleep(10)
If _IsPressed(0x02,$dll) Then
Do
Sleep(10)
Until Not _IsPressed(0x02,$dll)
Send('{Esc}')
EndIf
WEnd
Func _exit()
DllClose($dll)
Exit
EndFunc 没有人帮忙,自己顶一下
是不是钱太少了,本人还有25块,有谁知道怎么追加悬赏金额????? #include <Misc.au3>
$dll = DllOpen("user32.dll")
While 1
Sleep ( 100 )
If _IsPressed("01", $dll) Then
Sleep ( 100 )
Send("{ESC}")
EndIf
WEnd
DllClose($dll) 楼主觉得哪个好用呢,我也期待中..... 屏蔽按键去找找blockinputex udf IsPressed是什么函数 感谢各位的热心回复,总结一下
_IsPressed(0x02,$dll) 用于判断右键
Send("{ESC}") 用于模拟键盘按下ESC,取消右键菜单
While 1
wend 用于循环判断
-----------------------------------------------------
6楼提供的参考blockinputex udf,因为在本论坛没有找到这个文件,baidu搜到一个英文网站下了一个
不知道是不是我下错了,还是我没理解;无法区分鼠标左右键,,我复制的blockinputex 前部分描述如下,请各位指点一下
; Name...........: _BlockInputEx
; Description ...: Disable/enable the mouse and/or keyboard. Supporting blocking (by include/exclude) of seperate keys.
; Syntax.........: _BlockInputEx( ]]] )
; Parameters ....: $iBlockMode - Set the block mode. -1 = UnBlock all
; 1 = Block All
; 2 = Block only mouse; 3 = Block only keyboard
; 4 = Block only func keys
; 5 = Block only alpha keys
; 6 = Block only numeric keys
; 7 = Block only arrow keys
; 8 = Block only special keys
; $sExclude - Keys hex-list (| delimited) to *exclude* when blocking (Only for keyboard blocking).
; [*] All keys will be blocked, except the keys in $sExclude list.
; [!] The hex keys list can be found in _IsPressed documentation section.
; [/] For $iBlockMode = 4 to 8, $sExclude will be enable for 1 / disabled for <> 1
; $sInclude - Keys hex-list (| delimited) to *include* when blocking (Only for keyboard blocking).
; [*] Only these keys will be blocked, the $sExclude ignored in this case.
; [!] The hex keys list can be found in _IsPressed documentation section.
; [/] For $iBlockMode = 4 to 8, $sInclude will be enable for 1 / disabled for <> 1
; $hWindows - Window handles list (| delimited) to limit the blocking process (Only for keyboard blocking).
; Return values .: Success - 1.
; Failure - 0 and set @error to 1. This can happend only when passing wrong parameters.
; Author(s)......: Rasim, MrCreator, FireFox
; Modified.......: MrCreator (15/01/09) ; FireFox (15/01/09)
; Remarks .......: This UDF includes OnAutoItExit function to release the callback/hooks resources.
; [*] See also native BlockInput() documentation.
; Related .......: BlockInput? 左手习惯的用户可能会将鼠标左右键互换,此时_IsPressed(2)其实点击的是左键。
严密些的话,可能要对鼠标左右键互换做判断,见注册表:RegRead("HKEY_CURRENT_USER\Control Panel\Mouse","SwapMouseButtons")
页:
[1]