0

After receiving a mouse down event, my NSWindow is frozen. I'm unable to capture which threads hang in Xcode. I'm using the following code to simulate a mouse event:

CGEventSourceRef eventSource = CGEventSourceCreate(kCGEventSourceStateHIDSystemState);
CGEventRef event = CGEventCreateMouseEvent(eventSource, eventType, mouseLocation, mouseButton);
CGEventPost(kCGHIDEventTap, event);
CFRelease(event);

How can I resolve this?

pkamb
  • 33,281
  • 23
  • 160
  • 191
boopathy
  • 427
  • 2
  • 9
  • 20
  • If I send a mouse down/Up event on OS X default application like system preferences, disk utility and so on. Here It working properly. Which means I have to handle anything in my application window? – boopathy Apr 06 '15 at 06:53

1 Answers1

0

I have changed runloop mode from NSDefaultRunLoopMode to NSRunLoopCommonModes and It works.

boopathy
  • 427
  • 2
  • 9
  • 20