最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

autohotkey - How do I use a variable to define key updown? - Stack Overflow

programmeradmin1浏览0评论
test(key){
    send "{key down}" ;no
    ; send "{%key% down}" ;no
    sleep 500
    send "{key up}"
}
test("w") ;test(w) doesnt work either as per the manual

%key% works in AutoHotkey v1. For AutoHotkey v2 it says this works but it doesn't :

if InStr(MyVar, "fox")
    MsgBox "The variable MyVar contains the word fox."
test(key){
    send "{key down}" ;no
    ; send "{%key% down}" ;no
    sleep 500
    send "{key up}"
}
test("w") ;test(w) doesnt work either as per the manual

%key% works in AutoHotkey v1. For AutoHotkey v2 it says this works but it doesn't :

if InStr(MyVar, "fox")
    MsgBox "The variable MyVar contains the word fox."
Share Improve this question edited Feb 13 at 0:30 user4157124 3,00214 gold badges31 silver badges46 bronze badges asked Jan 20 at 15:09 kitekite 3133 silver badges15 bronze badges 0
Add a comment  | 

1 Answer 1

Reset to default 1
key:="up"
send "{" key " down}" 

is equivalent to

send "{up down}" 
发布评论

评论列表(0)

  1. 暂无评论