We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5e42dae + 3b6dca0 commit ba3e3e3Copy full SHA for ba3e3e3
je_auto_control/osx/listener/osx_keyboard_listener.py
@@ -0,0 +1,17 @@
1
+from Cocoa import *
2
+import time
3
+from Foundation import *
4
+from PyObjCTools import AppHelper
5
+
6
+class AppDelegate(NSObject):
7
+ def applicationDidFinishLaunching_(self, aNotification):
8
+ NSEvent.addGlobalMonitorForEventsMatchingMask_handler_(NSKeyDownMask, handler)
9
10
+def handler(event):
11
+ print(event)
12
+ print(str(hex(event.keyCode())))
13
14
+app = NSApplication.sharedApplication()
15
+delegate = AppDelegate.alloc().init()
16
+NSApp().setDelegate_(delegate)
17
+AppHelper.runEventLoop()
0 commit comments