Sending keystrokes/mouse clicks to a Java program

2019-08-14 08:57发布

Im trying to send keystrokes and mouse movements to a Java program but once the applicaton has focus nothing is sent. It's as if the Java application takes focus of everything because Autohotkey stops responding. Everything works fine in a regular Windows app (e.g. Notepad).

I've tried using various send methods (Send, SendInput, and SendEvent) but nothing works. Does anyone have any suggestions?

The program in particular is ThinkOrSwim's ThinkDesktop.

3条回答
爷的心禁止访问
2楼-- · 2019-08-14 09:20

I suggest you use Easy Macro Recorder

http://download.cnet.com/Easy-Macro-Recorder/3000-2094_4-10414139.html

Its a great tool to automate keystrokes and mouse movements. Hope this helps :)

查看更多
Emotional °昔
3楼-- · 2019-08-14 09:24

I was able to get my script running with ThinkOrSwim by running the SciTE editor as Administrator [or running the compiled scripts as Administrator].

The TOS UI had some refresh issues but my scripts went through fine to do what I needed to do.

查看更多
甜甜的少女心
4楼-- · 2019-08-14 09:24

Some playing around I've discovered that TOS on Mac OSX can be controlled via scripting with Keyboard Maestro. It's a ugly, hacked solution, but it works. You can edit text boxes and click stuff if you know the X,Y position of elements.

Keyboard Maestro can be run via scripts (AppleScript, Python, etc.) so maybe you can build some elaborate rube goldberg.

查看更多
登录 后发表回答