--
You received this message because you are subscribed to the Google Groups "Java Native Access" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jna-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jna-users/2a7485f0-9677-4d11-a22a-12b35e849cbfn%40googlegroups.com.
public static void main(String[] args) {
// AXUIElementRef app = CallApi.getElementRefByPid(39469);
CoreGraphicsFunctions CGF = CoreGraphicsFunctions.INSTANCE;
CGPoint mouseCursorPosition = CGPoint.CGPointMake(900F,334F);
System.out.println(mouseCursorPosition);
//
CGPoint(auto-allocated@0x7fdf04f13ae0 (8 bytes)) { float x@0x0=900.0 float y@0x4=334.0}
CGEventRef theEvent = CoreGraphicsFunctions.INSTANCE.CGEventCreateMouseEvent(null, kCGEventMouseMoved, mouseCursorPosition, kCGMouseButtonLeft);
CGF.CGEventPost(kCGHIDEventTap, theEvent);
CGF.CGEventSetType(theEvent, kCGEventLeftMouseDown);
CGF.CGEventPost(kCGHIDEventTap, theEvent); // Click!
CGF.CGEventSetType(theEvent, kCGEventLeftMouseUp);
CGF.CGEventPost(kCGHIDEventTap, theEvent);
CGF.CFRelease(theEvent);
}
CoreGraphicsFunctions CGF = CoreGraphicsFunctions.INSTANCE;
CGPoint mouseCursorPosition = CGPoint.CGPointMake(900F,334F);
System.out.println(mouseCursorPosition);
CGEventRef theEvent = CoreGraphicsFunctions.INSTANCE.CGEventCreateMouseEvent(null, kCGEventMouseMoved, null, kCGMouseButtonLeft);
CGF.CGEventPost(kCGHIDEventTap, theEvent);
CGF.CGEventSetType(theEvent, kCGEventLeftMouseDown);
CGF.CGEventPost(kCGHIDEventTap, theEvent); // Click!
CGF.CGEventSetType(theEvent, kCGEventLeftMouseUp);
CGF.CGEventPost(kCGHIDEventTap, theEvent);
CGF.CFRelease(theEvent);
2021年7月15日 上午2:52,'Hank Huang' via Java Native Access <jna-...@googlegroups.com> 写道:[EXTERNAL]
I tried these searches that were correct for me. The same code is a clickable position in swift, so I guess it’s the wrong CGPoint.2021年7月15日 上午1:14,Daniel Widdis <wid...@gmail.com> 写道:- this won't work if your app is sandboxed
--
You received this message because you are subscribed to the Google Groups "Java Native Access" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jna-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jna-users/2A8E5EBA-7DB2-4425-A0AA-9AE66BB8CC77%40ringcentral.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jna-users/41987C9C-2CA2-4802-B89A-9D74747E7444%40ringcentral.com.
2021年7月15日 上午8:34,Daniel B. Widdis <wid...@gmail.com> 写道:[EXTERNAL]
To view this discussion on the web visit https://groups.google.com/d/msgid/jna-users/CANb1Va4ZuT7KN4Kr5t3dxyMw6DHjG%2B6JUvcfDbnTD30w691yKA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jna-users/90B5FE4E-55BC-4847-B347-A1930D9406BC%40ringcentral.com.