Created
March 30, 2010 19:19
-
-
Save pepijndevos/349472 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Quartz import * | |
def MyFunction(*args): | |
print args | |
tap = CGEventTapCreate(kCGHIDEventTap, kCGHeadInsertEventTap, kCGEventTapOptionListenOnly, kCGEventLeftMouseDown, MyFunction, None) | |
runLoopSource = CFMachPortCreateRunLoopSource(None, tap, 0) | |
CFRunLoopAddSource(CFRunLoopGetCurrent(), runLoopSource, kCFRunLoopDefaultMode) | |
CGEventTapEnable(tap, True) | |
print tap | |
print runLoopSource | |
#CFRunLoopRun() | |
CFRunLoopRunInMode(kCFRunLoopDefaultMode, 20, False) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment