Mac os 代碼實現鼠標雙擊事件

for(int i = 0;i<4;i++)
    {
        CGEventSetIntegerValueField(theEvent,kCGMouseEventClickState,2);

        CGEventSetType(theEvent, kCGEventLeftMouseDown);

        CGEventPost(kCGHIDEventTap, theEvent);

        CGEventSetType(theEvent, kCGEventLeftMouseUp);

        CGEventPost(kCGHIDEventTap, theEvent);
    }
相關文章
相關標籤/搜索