开发者

How can I test drag-and-drop functionality between applications?

I'm writing a Cocoa app which allows the user to drag content to another application. I'd like to write an automated GUI test for this behavior.

I can move the mouse cursor using CGDisplayMoveCursorToPoint(). How开发者_运维技巧 can I issue mousedown and mouseup events to simulate a drag and drop operation?


CGEventRef down = CGEventCreateMouseEvent(eventSource, kCGEventLeftMouseDown,point, 0);

        CGEventPost(kCGSessionEventTap, down);

        CFRelease(down);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜