Autohotkey - 长按发送左控件,否则发送 Enter
Autohotkey - Send Left control on long press otherwise send Enter
这是我的脚本。 Capslock 映射为在长按时发送左控制,否则发送转义。这按预期工作。
SetCapsLockState, alwaysoff
Capslock::
Send {LControl Down}
KeyWait, CapsLock
Send {LControl Up}
if ( A_PriorKey = "CapsLock" ){
Send {Esc}
}
return
; Send left control when long pressed, otherwise behave a normal enter key
Enter::
send {LControl Down}
KeyWait, Enter, T5
Send {LControl Up}
if ( A_PriorKey = "Enter" ){
Send {Enter}
}
return
然而Enter键没有等待长按,超时quickly.This不是我的预期。它应该像上面的片段
如果我对问题的理解正确,这应该可以满足您的要求:
Enter::
SendInput, {LCtrl Down}
Sleep, 100
KeyWait, Enter
SendInput, {LCtrl Up}
if ( A_PriorKey = "Enter" ){
Send {Enter}
}
return
此外,我假设您在最后有一个按钮可以通过单个 Enter 键击。如果不是这种情况,并且您想要通过所有这些(同时按住 Enter),则以下内容将完成。
~Enter::
SendInput, {LCtrl Down}
Sleep, 100
KeyWait, Enter
SendInput, {LCtrl Up}
return
这是我的脚本。 Capslock 映射为在长按时发送左控制,否则发送转义。这按预期工作。
SetCapsLockState, alwaysoff
Capslock::
Send {LControl Down}
KeyWait, CapsLock
Send {LControl Up}
if ( A_PriorKey = "CapsLock" ){
Send {Esc}
}
return
; Send left control when long pressed, otherwise behave a normal enter key
Enter::
send {LControl Down}
KeyWait, Enter, T5
Send {LControl Up}
if ( A_PriorKey = "Enter" ){
Send {Enter}
}
return
然而Enter键没有等待长按,超时quickly.This不是我的预期。它应该像上面的片段
如果我对问题的理解正确,这应该可以满足您的要求:
Enter::
SendInput, {LCtrl Down}
Sleep, 100
KeyWait, Enter
SendInput, {LCtrl Up}
if ( A_PriorKey = "Enter" ){
Send {Enter}
}
return
此外,我假设您在最后有一个按钮可以通过单个 Enter 键击。如果不是这种情况,并且您想要通过所有这些(同时按住 Enter),则以下内容将完成。
~Enter::
SendInput, {LCtrl Down}
Sleep, 100
KeyWait, Enter
SendInput, {LCtrl Up}
return