But not sure how for AHK to listen to those inputs.
From node side, I've gathered that I can do something like this:
Code: Select all
import { ChildProcessWithoutNullStreams, spawn } from "child_process";
const child = spawn("C:/Program Files/AutoHotkey/v2/AutoHotkey64.exe", ["C:/scripts/AutoHotkey/v2/myScript.ahk"]);
and then I think I can do something like this:
child.stdin.write("Up" + "\n");
setTimeout(() => {
child.stdin.write("Left" + "\n");
}, 1000);
setTimeout(() => {
child.stdin.write("Stop" + "\n");
}, 2000);
setTimeout(() => {
child.kill();
}, 3000);