您好,欢迎来到二三娱乐。
搜索
您的当前位置:首页2018-10-15 ahk定义按键双击效果如何保证其他时候组合

2018-10-15 ahk定义按键双击效果如何保证其他时候组合

来源:二三娱乐

最开始在脚本中定义了lctrl,lalt双击切换输入法:

/*
LAlt::  ; why unable to use in input box by srun
if (A_PriorHotkey <> "LAlt" or A_TimeSincePriorHotkey > 400)
{
    ; Too much time between presses, so this isn't a double-press.
    KeyWait, LAlt
    return
}
;SendInput {Enter}
;gosub NextIME
gosub en
return

LCtrl::  ; why unable to use in input box by srun
if (A_PriorHotkey <> "LCtrl" or A_TimeSincePriorHotkey > 400)
{
    ; Too much time between presses, so this isn't a double-press.
    KeyWait, LCtrl
    return
}
;gosub NextIME
gosub cn
return
*/

使用时发现其他使用ctrl或者alt的组合键无法使用了?!
于是想办法修改上述代码:

~LCtrl::  
if (A_PriorHotkey = "~LCtrl" and A_TimeSincePriorHotkey < 400)
{
gosub cn
}
return
~LAlt::  
if (A_PriorHotkey = "~LAlt" and A_TimeSincePriorHotkey < 400)
{
gosub en
}
return

这样,果然OK了!

Copyright © 2019- yule263.com 版权所有 湘ICP备2023023988号-1

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务