Re: [Pyobjc-dev] unexpected error
Brought to you by:
ronaldoussoren
From: Ken T. <ke...@co...> - 2014-10-08 13:56:39
|
On Oct 8, 2014, at 5:48 AM, Eric Le Lay <ker...@us...> wrote: > tap = Quartz.CGEventTapCreate( > Quartz.kCGSessionEventTap, > Quartz.kCGHeadInsertEventTap, > Quartz.kCGEventTapOptionDefault, > # NSSystemDefined for media keys > Quartz.CGEventMaskBit(NSSystemDefined), > self.eventTap, > None > ) > port = NSMachPort.alloc().initWithMachPort_options_(CFMachPortGetPort(tap), NSMachPortDeallocateNone) > loop = NSRunLoop.currentRunLoop() > loop.addPort_forMode_(port, NSDefaultRunLoopMode) Why are you not doing what the docs for CGEventTapCreate() suggest: pass the CFMachPortRef returned from it to CFMachPortCreateRunLoopSource() and then add the resulting source to the run loop using CFRunLoopAddSource()? Regards, Ken |