#Requires AutoHotkey v2.0
;#NoTrayIcon

; filename: change-game-keys.ahk

; https://www.autohotkey.com/

; IniWrite
; IniRead https://wyagd001.github.io/v2/docs/lib/IniRead.htm
; https://wyagd001.github.io/v2/docs/Program.htm#tray-icon

; 自定义的函数
; 任意一个窗口激活都返回true
WinActiveAny(titles*)
{
    for index, element in titles ; 在大多数情况下建议使用枚举的方式.
    {
        if WinActive(element)
            return true ;
    }
    return false ;
}



g_titles := ["xxx", "yyyy"]
#HotIf WinActiveAny(g_titles*)
    ; 把wsad映射为上下左右
    ; https://wyagd001.github.io/v2/docs/KeyList.htm#Joystick
    w::Up     ;    ↑(上方向键)
    s::Down    ;     ↓(下方向键)
    a::Left    ;    ←(左方向键)
    d::Right    ;    →(右方向键)
    l::Enter  ; 确认
    m::Esc    ; 取消
    o::LShift  ; 快速移动
#HotIf
作者:张三  创建时间:2026-03-11 23:05
最后编辑:张三  更新时间:2026-03-11 23:07