ahk-js
v0.1.1
Published
Autohotkey automation into NodeJS
Downloads
6
Maintainers
Readme
CURRENT IN DEVELOPMENT
PULL REQUESTS ARE WELCOME!
Install
npm install ahk-js
# OR
yarn add ahk-js
Usage
You can import providers like:
import { Keyboard, Mouse, Window } from 'ahk-js';
Mouse
click
Mouse.click({
button?: 'left' | 'middle' | 'right' | 'x1' | 'x2';
x?: number;
y?: number;
count?: string;
speed?: string;
downOrUp?: '' | 'D' | 'U';
relative?: string;
})
drag
Mouse.drag({
button?: 'left' | 'middle' | 'right' | 'x1' | 'x2';
x: number;
y: number;
toX: number;
toY: number;
speed?: string;
relative?: string;
})
move
Mouse.move({
x: number;
y: number;
speed? : string;
relative? : string;
})
getPos
Mouse.getPos({
flag?: number
})
Keyboard
type
Keyboard.type(text: string)
send
Keyboard.send(keys: string, {
ctrl?: boolean;
shift?: boolean;
alt?: boolean;
win?: boolean;
})
getKeyState
Keyboard.getPos(key: string, mode?: 'P' | 'T')
Window
activate
Window.activate({
title?: ahk_class | ahk_id | ahk_pid | ahk_exe | string;
text?: string;
excludeTitle?: string;
excludeText?: string;
})
close
Window.close({
title?: ahk_class | ahk_id | ahk_pid | ahk_exe | string;
text?: string;
excludeTitle?: string;
excludeText?: string;
secondsToWait?: number;
})
exist
Window.exist({
title?: ahk_class | ahk_id | ahk_pid | ahk_exe | string;
text?: string;
excludeTitle?: string;
excludeText?: string;
})
hide
Window.hide({
title?: ahk_class | ahk_id | ahk_pid | ahk_exe | string;
text?: string;
excludeTitle?: string;
excludeText?: string;
})
kill
Window.kill({
title?: ahk_class | ahk_id | ahk_pid | ahk_exe | string;
text?: string;
excludeTitle?: string;
excludeText?: string;
secondsToWait?: number;
})
maximize
Window.maximize({
title?: ahk_class | ahk_id | ahk_pid | ahk_exe | string;
text?: string;
excludeTitle?: string;
excludeText?: string;
})
minimize
Window.minimize({
title?: ahk_class | ahk_id | ahk_pid | ahk_exe | string;
text?: string;
excludeTitle?: string;
excludeText?: string;
})
restore
Window.restore({
title?: ahk_class | ahk_id | ahk_pid | ahk_exe | string;
text?: string;
excludeTitle?: string;
excludeText?: string;
})