简体   繁体   English

Autohotkey 和 StrokesPlus 之间的冲突

[英]Conflict between Autohotkey and StrokesPlus

I am using StrokesPlus (mouse gestures that uses SendKeys ) with the following short-cut to to close windows:我正在使用StrokesPlus (使用SendKeys 的鼠标手势)和以下快捷方式来关闭窗口:

acSendKeys("{DELAY=50}^{F_4}")

The default close windows is control+w, but not all programs accept that (UltraEdit, for one, uses control+F4 - with control+w toggling word-wrap, which I use a lot).默认关闭窗口是 control+w,但并非所有程序都接受(例如,UltraEdit 使用 control+F4 - 使用 control+w 切换自动换行,我经常使用它)。

I am also using Florian Winkelbauer's 4 Clip , which binds F1-F4 to clipboards, so F1+c, F1+v etc for copy/paste to the first clipboard.我还使用Florian Winkelbauer 的 4 Clip ,它将 F1-F4 绑定到剪贴板,因此 F1+c、F1+v 等用于复制/粘贴到第一个剪贴板。 A sample of the bindings from 4clip are below.来自 4clip 的绑定示例如下。

*F1::SendInput {blind}{F1}
*F2::SendInput {blind}{F2}
*F3::SendInput {blind}{F3}
*F4::SendInput {blind}{F4}

; F3 + F$
F3 & F4::
    Gosub SetDelimiter
return

; F4
F4 & c::CopyClipboard(4)
F4 & a::AppendClipboard(4)
F4 & s::SwapClipboard(4)
F4 & p::PrintClipboard(4)
F4 & v::PasteClipboard(c4)
F4 & b::PasteClipboard(cp4)
F4 & d::Clear(4)

The problem I find is that when I use the StrokesPlus shortcut, the window closes but then the system is left as though the control key is still depressed: I can press escape and the start menu appears (just as it does when you press control+escape).我发现的问题是,当我使用 StrokesPlus 快捷方式时,窗口会关闭,但随后系统就好像仍然按下了控制键一样:我可以按 Esc 并出现开始菜单(就像按 control+ 时那样)逃脱)。

I have replicated this on both Windows 7 64 bit and Windows XP 64 bit.我已经在 Windows 7 64 位和 Windows XP 64 位上复制了这个。

I have confirmed that if I comment out all the F4 bindings in 4 clip, the problem goes away.我已经确认,如果我注释掉 4 剪辑中的所有 F4 绑定,问题就会消失。

I have also posted this on the StrokesPlus forum and the Autohotkey forum .我也在StrokesPlus 论坛Autohotkey 论坛上发布了这个。

Solved by Rob (the author of StrokesPlus ) in his reply to my post on the StrokesPlus forum.RobStrokesPlus的作者)在他对我在 StrokesPlus论坛上的帖子的回复中解决

acSendControlDown()
acSendKeys("{F_4}")
acSendControlUp()

Use the above in StrokesPlus instead of the default:在 StrokesPlus 中使用上述而不是默认值:

acSendKeys("{DELAY=50}^{F_4}") acSendKeys("{DELAY=50}^{F_4}")

This is because the Ctrl key is occupied as "ignore key" in StrokesPlus by default, which means when the Ctrl key is pressed down, all mouse gestures are temporarily disabled.这是因为Ctrl键在StrokesPlus默认被占用为“忽略键”,这意味着当按下Ctrl键时,所有鼠标手势都会暂时禁用。

If you don't use this feature, you can go to Preference and set the "ignore key" to "None".如果您不使用此功能,您可以进入首选项并将“忽略键”设置为“无”。 Then you can write Ctrl keys into scripts as usual.然后您可以像往常一样将Ctrl键写入脚本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM