[英]LButton Hotkey seems to prevent Send, {LButton}
I'm at a loss here.我在这里不知所措。 As soon as I add the LButton hotkey, the Send, {LButton} doesn't seem to work, but they show up in recently executed lines.
一旦我添加LButton热键,Send, {LButton} 似乎不起作用,但它们出现在最近执行的行中。
Env.环境。 Windows 7x64, Disabled Touchpad, AHK v1.1.31.01.
Windows 7x64,禁用触摸板,AHK v1.1.31.01。
I try to emulate the Wink application (from DebugMode) to capture screenshots for training purposes.我尝试模拟 Wink 应用程序(来自 DebugMode)来捕获屏幕截图以用于培训目的。 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.
但是我无法让它工作。
Step 1: I just reduced it to this simple script:第 1 步:我只是将其简化为这个简单的脚本:
#InstallKeybdHook
#InstallMouseHook
#UseHook
#Persistent
Return
a::
Send, {LButton}
Return
q::
ExitApp
When using this script, I can simulate clicking the Left Mouse Button through the a key.使用此脚本时,我可以模拟通过a键单击鼠标左键。 Nothing special.
没什么特别的。 However as soon as I add either a line with "Hotkey, $LButton, MySendClick", or "$LButton::" the previously working a hotkey no longer works.
但是,一旦我添加了一行带有“Hotkey、$LButton、MySendClick”或“$LButton::”的行,以前工作的热键就不再起作用了。 In the recently executed lines, you can see the "Send, {LButton}" lines, but nothing is being send.
在最近执行的行中,您可以看到“发送,{LButton}”行,但没有发送任何内容。 Unexpectedly, the a hotkey actually causes the "$LButton::" hotkey to trigger (without it sending {LButton}).
出乎意料的是, a热键实际上会触发“$LButton::”热键(没有它发送 {LButton})。 When I change the a hotkey to send "RButton" and the $LButton:: to $RButton::, then Send {Click} works perfectly (eventhough the a hotkey should never be able to trigger $RButton::).
当我将a热键更改为发送“RButton”并将 $LButton:: 更改为 $RButton:: 时,Send {Click} 可以完美运行(即使a热键永远无法触发 $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
I upgraded from AHK v1.1.22.04 to v1.1.31.01.我从 AHK v1.1.22.04 升级到 v1.1.31.01。 No improvement.
没提升。
I tried "Click", "sendInput, {LButton}", "Send {Click}", "MouseClick, Left".我试过“点击”、“发送输入,{LButton}”、“发送{点击}”、“鼠标点击,左”。
I tried "$LButton::", "vk01sc000::", "Hotkey, $LButton, MyClick".我试过“$LButton::”、“vk01sc000::”、“热键、$LButton、MyClick”。
Is this an issue with my specific Windows 7 configuration or an "undocumented AHK feature"?这是我的特定 Windows 7 配置或“未记录的 AHK 功能”的问题吗?
#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
In this last test example, When $LButton:: is disabled, the a hotkey works like a charm, but as soon as I enable $LButton::, the a hotkey triggers $LButton:: and no mouse click is being sent to the windows applications.在最后一个测试示例中,当 $LButton:: 被禁用时, a热键就像一个魅力,但是一旦我启用 $LButton::, a热键就会触发 $LButton:: 并且没有鼠标点击被发送到windows 应用。
I would appreciate it when other Windows 7 users could quickly test this issue.当其他 Windows 7 用户可以快速测试此问题时,我将不胜感激。
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 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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.