#Requires AutoHotkey v2.0 ; MichelKeys: thin AutoHotkey keyboard primitive runner for MCSJ. ; Usage: ; AutoHotkey64.exe MichelKeys.ahk press TAB 5 ; AutoHotkey64.exe MichelKeys.ahk paste "text" ; AutoHotkey64.exe MichelKeys.ahk combo "!f" ; Alt+F SetTitleMatchMode 2 DetectHiddenWindows false json(s) => StrReplace(StrReplace(s, '\\', '\\\\'), '"', '\"') ActivateMCSJ() { if WinExist("MCSJ - 2026.1") { WinActivate WinWaitActive("MCSJ - 2026.1", , 2) return WinGetTitle("A") } if WinExist("MCSJ") { WinActivate WinWaitActive("MCSJ", , 2) return WinGetTitle("A") } return "" } cmd := A_Args.Length >= 1 ? A_Args[1] : "state" title := ActivateMCSJ() if (cmd = "press") { key := A_Args.Length >= 2 ? A_Args[2] : "TAB" count := A_Args.Length >= 3 ? Integer(A_Args[3]) : 1 Loop count { SendInput "{" key "}" Sleep 35 } FileAppend('{"ok":true,"method":"AutoHotkey","action":"press","key":"' json(key) '","count":' count ',"title":"' json(title) '"}`n', "*") } else if (cmd = "paste") { text := A_Args.Length >= 2 ? A_Args[2] : "" A_Clipboard := text ClipWait 1 SendInput "^v" FileAppend('{"ok":true,"method":"AutoHotkey","action":"paste","chars":' StrLen(text) ',"title":"' json(title) '"}`n', "*") } else if (cmd = "combo") { keys := A_Args.Length >= 2 ? A_Args[2] : "" SendInput keys FileAppend('{"ok":true,"method":"AutoHotkey","action":"combo","keys":"' json(keys) '","title":"' json(title) '"}`n', "*") } else { FileAppend('{"ok":true,"method":"AutoHotkey","action":"state","title":"' json(title) '"}`n', "*") }