简体   繁体   中英

Conflict between Autohotkey and StrokesPlus

I am using StrokesPlus (mouse gestures that uses SendKeys ) with the following short-cut to to close windows:

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).

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. A sample of the bindings from 4clip are below.

*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).

I have replicated this on both Windows 7 64 bit and Windows XP 64 bit.

I have confirmed that if I comment out all the F4 bindings in 4 clip, the problem goes away.

I have also posted this on the StrokesPlus forum and the Autohotkey forum .

Solved by Rob (the author of StrokesPlus ) in his reply to my post on the StrokesPlus forum.

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

Use the above in StrokesPlus instead of the default:

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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