Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All input calls fails after Windows.SetActive #24

Open
kiddyfurby opened this issue May 18, 2017 · 2 comments
Open

All input calls fails after Windows.SetActive #24

kiddyfurby opened this issue May 18, 2017 · 2 comments
Labels
Bug An error or incorrect implementation

Comments

@kiddyfurby
Copy link

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");
@kiddyfurby
Copy link
Author

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.

@dkrutsko
Copy link
Member

@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.

@dkrutsko dkrutsko added the Bug An error or incorrect implementation label Jul 19, 2017
@dkrutsko dkrutsko added this to the Robot-js 3.0.0 milestone Aug 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug An error or incorrect implementation
Development

No branches or pull requests

2 participants