def run(self):
self.tap = Quartz.CGEventTapCreate(<EOL>Quartz.kCGSessionEventTap,<EOL>Quartz.kCGHeadInsertEventTap,<EOL>Quartz.kCGEventTapOptionDefault,<EOL>Quartz.CGEventMaskBit(Quartz.kCGEventLeftMouseDown) |<EOL>Quartz.CGEventMaskBit(Quartz.kCGEventLeftMouseUp) |<EOL>Quartz.CGEventMaskBit(Quartz.kCGEventRightMouseDown) |<EOL>Quartz.CGEventMaskBit(Quartz.kCGEventRightMouseUp) |<EOL>Quartz.CGEventMaskBit(Quartz.kCGEventOtherMouseDown) |<EOL>Quartz.CGEventMaskBit(Quartz.kCGEventOtherMouseUp) |<EOL>Quartz.CGEventMaskBit(Quartz.kCGEventMouseMoved) |<EOL>Quartz.CGEventMaskBit(Quartz.kCGEventScrollWheel),<EOL>self.handler,<EOL>None)<EOL>loopsource = Quartz.CFMachPortCreateRunLoopSource(None, self.tap, <NUM_LIT:0>)<EOL>loop = Quartz.CFRunLoopGetCurrent()<EOL>Quartz.CFRunLoopAddSource(loop, loopsource, Quartz.kCFRunLoopDefaultMode)<EOL>Quartz.CGEventTapEnable(self.tap, True)<EOL>while self.listening:<EOL><INDENT>Quartz.CFRunLoopRunInMode(Quartz.kCFRunLoopDefaultMode, <NUM_LIT:5>, False)<EOL><DEDENT>
Creates a listener and loops while waiting for an event. Intended to run as
        a background thread.