[英]Sending Ctrl+K Ctrk+U does not work, Ctrl+K Ctrl+C does
I just play around a bit with AHK and I thought I could outsource some of my SSMS macros to AHK. 我只是和AHK玩了一下,我想我可以将一些SSMS宏外包给AHK。
Now I have a problem with a rather simple macro: 现在我有一个相当简单的宏的问题:
;+++++ ALT + ScrollUp +++++
!WheelUp::
;##### SQL MANAGEMENT STUDIO #####
IfWinActive, Microsoft SQL Server Management Studio
{
Send, {Control Down}ku{Control Up}
}
;+++++ ALT + ScrollDown +++++
!WheelDown::
;##### SQL MANAGEMENT STUDIO #####
IfWinActive, Microsoft SQL Server Management Studio
{
Send, {Control Down}kc{Control Up}
}
So if I scroll down while pressing the Alt key, I want it to send Ctrl + K Ctrl + C to SSMS (Comment selection). 因此,如果我在按下Alt键的同时向下滚动,我希望它将Ctrl + K Ctrl + C发送到SSMS(注释选择)。 This works fine, but if I want to send Ctrl + K Ctrl + U (Uncomment selection) it only uncomments it for a millisecond before it gets commented again.
这样可以正常工作,但如果我想发送Ctrl + K Ctrl + U (取消注释选择),它只会在再次注释之前将其取消注释一毫秒。
Now the code is not really complex, what am I missing? 现在代码并不复杂,我错过了什么?
I've already tried to change the hotkey to Shift +Scrolling or Ctrl +Scrolling, same effect. 我已经尝试将热键更改为Shift + Scrolling或Ctrl + Scrolling,效果相同。 I also tried to bind it to a normal key like Ctrl + 3 and Ctrl + 4 , same effect.
我也尝试将它绑定到普通键,如Ctrl + 3和Ctrl + 4 ,效果相同。
I think that if you put a return after each Wheelcommand it will work. 我想如果你在每个Wheelcommand之后放回一个它会起作用。 Now it will continue with the next command (undoing your initial command).
现在它将继续执行下一个命令(撤消初始命令)。
;+++++ ALT + ScrollUp +++++
!WheelUp::
;##### SQL MANAGEMENT STUDIO #####
IfWinActive, Microsoft SQL Server Management Studio
{
Send, {Control Down}ku{Control Up}
}
Return
;+++++ ALT + ScrollDown +++++
!WheelDown::
;##### SQL MANAGEMENT STUDIO #####
IfWinActive, Microsoft SQL Server Management Studio
{
Send, {Control Down}kc{Control Up}
}
Return
Let me know how this works! 让我知道这是如何工作的!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.