【问题标题】:LButton Hotkey seems to prevent Send, {LButton}LButton Hotkey 似乎阻止了发送,{LButton}
【发布时间】:2020-03-03 10:50:45
【问题描述】:

我在这里不知所措。一旦我添加 LButton 热键,Send, {LButton} 似乎不起作用,但它们会出现在最近执行的行中。

环境。 Windows 7x64,禁用触摸板,AHK v1.1.31.01。

我尝试模拟 Wink 应用程序(来自 DebugMode)来捕获屏幕截图以用于培训目的。出于这个原因,我想在鼠标单击之前捕获一个屏幕截图。这看起来很简单,我什至隐约记得过去做过类似的鼠标热键。但是我无法让它工作。

第 1 步:我只是将其简化为这个简单的脚本:

#InstallKeybdHook
#InstallMouseHook
#UseHook
#Persistent
Return

a::
  Send, {LButton}
Return

q::
ExitApp

使用此脚本时,我可以通过 a 键模拟单击鼠标左键。没什么特别的。 然而,只要我添加了一行带有“Hotkey、$LButton、MySendClick”或“$LButton::”的行,以前工作的 a 热键就不再工作了。在最近执行的行中,您可以看到“发送,{LButton}”行,但没有发送任何内容。出乎意料的是,a 热键实际上会触发“$LButton::”热键(没有发送 {LButton})。当我将 a 热键更改为发送“RButton”并将 $LButton:: 更改为 $RButton:: 时,Send {Click} 可以完美运行(尽管 a 热键应该永远无法触发 $RButton::)。

最初我只是想拥有以下 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。没有得到改善。

我试过“点击”、“发送输入,{LButton}”、“发送{点击}”、“鼠标点击,左”。

我尝试了“$LButton::”、“vk01sc000::”、“热键、$LButton、MyClick”。

这是我的特定 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

在最后一个测试示例中,当 $LButton:: 被禁用时,a 热键就像一个魅力,但一旦我启用 $LButton::,a kbd> 热键触发 $LButton:: 并且没有鼠标点击被发送到 windows 应用程序。

如果其他 Windows 7 用户能够快速测试此问题,我将不胜感激。

【问题讨论】:

  • 我知道您已经询问了 Windows 7 用户。我没有,但仅供参考,它可以在我的机器上的 Windows 10 中正常运行。

标签: autohotkey mouse-buttons


【解决方案1】:

根据我的经验,使用仍希望输入通过的键需要波浪号前缀。

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 之后进行,这违背了目的。
猜你喜欢
  • 1970-01-01
  • 2012-11-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-04-15
相关资源
最近更新 更多