Robot/robot-js

All input calls fails after Windows.SetActive

Opened this issue · 2 comments

After calling robot.Window.setActive, none of the input calls (robot.Mouse.setPos, mouse.click, keyboard.click) would work.

If I comment out the setActive line, everything works as expected. SetActive itself works because the window was brought to the front, but any subsequent input events would silently fail.

System: Windows 10 x64, Node JS v6.3.1 using precompiled robot binary.

Here's my code:

var robot = require ("robot-js");
const data_memory_xy = robot.Point(310,493)

var list = robot.Window.getList (".*STVP.*")
if (list.length === 0) {
	console.log("Please run STVP")
	process.exit(0)
}
var win = list[0]
robot.Window.setActive(win)

var mouse = robot.Mouse();
robot.Mouse.setPos(data_memory_xy)
mouse.click(robot.BUTTON_LEFT);

var keyboard = robot.Keyboard();
keyboard.click("123");

Sorry. Its the problem of the target app I am trying to automate.
Apparently it handles inputs differently. Robot works for normal apps like Notepad.

I was trying to automate STVD: http://www.st.com/en/development-tools/stvd-stm8.html
And neither Robot or RobotJS(http://robotjs.io/) can send mouse / key events to it.

@kiddyfurby Sorry for the late reply. I'm actually aware that some apps refuse to work and I think it's due to a special flag that windows uses when calling SendInput. It's something that I'm continuing to research over at the main robot library.