I run a java application in login window using LaunchAgents ,which captures mouse and keyboard events remotely and executes it. The keyboard events work properly but not the mouse events.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.ash.login</string>
<key>LimitLoadToSessionType</key>
<string>LoginWindow</string>
<key>RunAtLoad</key>
<true/>
<key>Program</key>
<string>/usr/bin/java</string>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/java</string>
<string>-jar</string>
<string>-Dapple.awt.uielement=true</string> (Works sometimes without this option)
<string>/Library/Ash_Agent/data/remote.jar</string>
</array>
<key>KeepAlive</key>
<true/>
</dict>
</plist>
captureImage.robot.mousePress( InputEvent.BUTTON1_MASK ); (Used inside the code)
I'm not able to gain control of the mouse at loginwindow. Works fine in aqua or when logged in. * Console errors : *
Untrusted apps are not allowed to connect to or launch Window Server before login.
Window Server is not available
我相信这是因为Robot内部使用CGEventPost而不是已弃用的CGPostMouseEvent,但是CGEventPost无法正常登录。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.