游戏包括网游:apex,单机:大镖客2、战神4、2077
只有a::b这种一行的指令能生效,多行指令用send实现映射的效果却无效
apex里按住a,会一顿一顿地按b;
战神4用send无效,用
sendinput {a down}
sleep 50
sendinput {a up}
这种方式有效
大镖客2里上面的方式又无效,sendinput、sendplay等也无效
脚本是管理员模式运行、游戏也是窗口化
有没有大部分游戏都能生效的写法呢?
既然"::"这种方式在所有游戏里都能生效,那怎么写能完全替代它的效果?
大量游戏只有a::b这种单行映射有效,send无效
Moderators: tmplinshi, arcticir
Re: 大量游戏只有a::b这种单行映射有效,send无效
DllCall
Code: Select all
#Requires AutoHotkey >=2.0
#Warn
#SingleInstance
ID := WinGetID("A")
a::SendKey("b", ID) ; a::b
s::SendKey("d", ID) ; s::d
SendKey(Key, hWnd){
VK := GetKeyVK(Key),SC := GetKeySC(Key)
DllCall("keybd_event", "UChar", VK, "UChar", SC, "UInt", 0, "UPtr", 0)
Sleep 100
DllCall("keybd_event", "UChar", VK, "UChar", SC, "UInt", 2, "UPtr", 0)
}
F4::ExitApp
Re: 大量游戏只有a::b这种单行映射有效,send无效
WKen wrote: ↑02 May 2024, 12:38DllCallCode: Select all
#Requires AutoHotkey >=2.0 #Warn #SingleInstance ID := WinGetID("A") a::SendKey("b", ID) ; a::b s::SendKey("d", ID) ; s::d SendKey(Key, hWnd){ VK := GetKeyVK(Key),SC := GetKeySC(Key) DllCall("keybd_event", "UChar", VK, "UChar", SC, "UInt", 0, "UPtr", 0) Sleep 100 DllCall("keybd_event", "UChar", VK, "UChar", SC, "UInt", 2, "UPtr", 0) } F4::ExitApp
啊啊啊,太感谢了,非常有效!
Who is online
Users browsing this forum: No registered users and 8 guests