问题描述
我在这里不知所措.一旦添加了热键,发送{LButton}"似乎不起作用,但是它们显示在最近执行的行中.
I'm at a loss here. As soon as I add the hotkey, the Send, {LButton} doesn't seem to work, but they show up in recently executed lines.
Env. Windows 7x64,禁用的触摸板,AHK v1.1.31.01.
Env. Windows 7x64, Disabled Touchpad, AHK v1.1.31.01.
我尝试模拟Wink应用程序(从DebugMode中)以捕获屏幕截图以进行培训.因此,我想在单击鼠标之前捕获一个屏幕截图.这看起来很容易,我什至还记得以前曾经做过类似的鼠标热键.但是我无法使它正常工作.
I try to emulate the Wink application (from DebugMode) to capture screenshots for training purposes. For that reason, I want to capture a screenshot just before a mouse click. This looks easy, and I even vaguely remember doing similar mouse hotkeys in the past. However I can't get this to work.
步骤1:我只是将其简化为以下简单脚本:
Step 1: I just reduced it to this simple script:
#InstallKeybdHook
#InstallMouseHook
#UseHook
#Persistent
Return
a::
Send, {LButton}
Return
q::
ExitApp
使用此脚本时,我可以模拟通过键单击鼠标左键.没什么特别的.但是,只要我添加带有"Hotkey,$ LButton,MySendClick"或"$ LButton ::"的行,以前可用的热键就不再起作用.在最近执行的行中,您可以看到"Send,{LButton}"行,但未发送任何内容.出乎意料的是,热键实际上导致触发"$ LButton ::"热键(没有发送{LButton}).当我将热键更改为发送"RButton"和将$ LButton ::更改为$ RButton ::时,发送{Click}效果很好(尽管热键应永远无法触发$ RButton ::).
When using this script, I can simulate clicking the Left Mouse Button through the key. Nothing special.However as soon as I add either a line with "Hotkey, $LButton, MySendClick", or "$LButton::" the previously working hotkey no longer works. In the recently executed lines, you can see the "Send, {LButton}" lines, but nothing is being send. Unexpectedly, the hotkey actually causes the "$LButton::" hotkey to trigger (without it sending {LButton}). When I change the hotkey to send "RButton" and the $LButton:: to $RButton::, then Send {Click} works perfectly (eventhough the hotkey should never be able to trigger $RButton::).
最初我只是想拥有以下热键:
Originally I just wanted to have the following HotKey:
$LButton::
SoundBeep, 300, 150 ; For testing only
; Send, ^{PrintScreen} ; To trigger Greenshot in the background
Sleep, 100
Send, {LButton}
Return
我从AHK v1.1.22.04升级到v1.1.31.01.没提升.
I upgraded from AHK v1.1.22.04 to v1.1.31.01. No improvement.
我尝试了"Click","sendInput,{LButton}",发送{Click}","MouseClick,Left".
I tried "Click", "sendInput, {LButton}", "Send {Click}", "MouseClick, Left".
我尝试了"$ LButton ::","vk01sc000 ::",热键,$ LButton,MyClick".
I tried "$LButton::", "vk01sc000::", "Hotkey, $LButton, MyClick".
这是我的特定Windows 7配置或未记录的AHK功能"的问题吗?
Is this an issue with my specific Windows 7 configuration or an "undocumented AHK feature"?
#InstallKeybdHook
#InstallMouseHook
#UseHook
#Persistent
Return
a::
Send, {LButton}
Return
$LButton::
SoundBeep, 300, 150 ; Should be Send, ^{PrintScreen} ; To trigger Greenshot in the background
MouseClick, Left
Return
q::
ExitApp
在最后一个测试示例中,当禁用$ LButton ::时,热键就像一个超级按钮一样工作,但是一旦启用$ LButton ::,即热键触发$ LButton ::,并且没有鼠标单击发送到Windows应用程序.
In this last test example, When $LButton:: is disabled, the hotkey works like a charm, but as soon as I enable $LButton::, the hotkey triggers $LButton:: and no mouse click is being sent to the windows applications.
当其他Windows 7用户可以快速测试此问题时,我将不胜感激.
I would appreciate it when other Windows 7 users could quickly test this issue.
推荐答案
根据我的经验,使用仍希望输入传递的键需要Tilde前缀.
In my experience, using keys that you still want the input to pass through need the Tilde prefix.
https://www.autohotkey.com/docs/Hotkeys.htm#Tilde
~LButton::
SoundBeep, 300, 150 ; Should be Send, ^{PrintScreen} ; To trigger Greenshot in the background
KeyWait, LButton ; Wait for lbutton to be released.
Return
这篇关于LButton热键似乎阻止发送{LButton}的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!