本文整理汇总了Python中Cocoa.NSEvent.addGlobalMonitorForEventsMatchingMask_handler_方法的典型用法代码示例。如果您正苦于以下问题:Python NSEvent.addGlobalMonitorForEventsMatchingMask_handler_方法的具体用法?Python NSEvent.addGlobalMonitorForEventsMatchingMask_handler_怎么用?Python NSEvent.addGlobalMonitorForEventsMatchingMask_handler_使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cocoa.NSEvent
的用法示例。
在下文中一共展示了NSEvent.addGlobalMonitorForEventsMatchingMask_handler_方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: applicationDidFinishLaunching_
# 需要导入模块: from Cocoa import NSEvent [as 别名]
# 或者: from Cocoa.NSEvent import addGlobalMonitorForEventsMatchingMask_handler_ [as 别名]
def applicationDidFinishLaunching_(self, notification):
NSLog("Application did finish launching...")
# Register preferance defaults for user-facing preferences
prefDictionary = {}
prefDictionary[u"screenshots"] = True
prefDictionary[u'imageSize'] = 720 # in px
prefDictionary[u"imageTimeMax"] = 60 # in s
prefDictionary[u"imageTimeMin"] = 100 # in ms
prefDictionary[u"experienceTime"] = 1800 # in s
prefDictionary[u"experienceLoop"] = True
prefDictionary[u"recording"] = True
NSUserDefaultsController.sharedUserDefaultsController().setInitialValues_(prefDictionary)
mask = (NSKeyDownMask
| NSKeyUpMask
| NSLeftMouseDownMask
| NSLeftMouseUpMask
| NSRightMouseDownMask
| NSRightMouseUpMask
| NSMouseMovedMask
| NSScrollWheelMask
| NSFlagsChangedMask)
NSEvent.addGlobalMonitorForEventsMatchingMask_handler_(mask, sc.handler)
self.createStatusMenu()
# self.createStatusButton()
NSNotificationCenter.defaultCenter().postNotificationName_object_('checkLoops',self)
NSNotificationCenter.defaultCenter().postNotificationName_object_('noteRecordingState',self)
示例2: applicationDidFinishLaunching_
# 需要导入模块: from Cocoa import NSEvent [as 别名]
# 或者: from Cocoa.NSEvent import addGlobalMonitorForEventsMatchingMask_handler_ [as 别名]
def applicationDidFinishLaunching_(self, notification):
mask = (NSKeyDownMask
| NSLeftMouseDownMask
| NSLeftMouseUpMask
| NSRightMouseDownMask
| NSRightMouseUpMask
| NSMouseMovedMask
| NSScrollWheelMask)
NSEvent.addGlobalMonitorForEventsMatchingMask_handler_(mask, sc.handler)
示例3: applicationDidFinishLaunching_
# 需要导入模块: from Cocoa import NSEvent [as 别名]
# 或者: from Cocoa.NSEvent import addGlobalMonitorForEventsMatchingMask_handler_ [as 别名]
def applicationDidFinishLaunching_(self, notification):
#print "Sucessfully launched Obj-C application"
mask = (NSKeyDownMask
| NSLeftMouseDownMask
| NSRightMouseDownMask
| NSMouseMovedMask
| NSScrollWheelMask)
#| NSFlagsChangedMask)
NSEvent.addGlobalMonitorForEventsMatchingMask_handler_(mask, sc.handler)
示例4: applicationDidFinishLaunching_
# 需要导入模块: from Cocoa import NSEvent [as 别名]
# 或者: from Cocoa.NSEvent import addGlobalMonitorForEventsMatchingMask_handler_ [as 别名]
def applicationDidFinishLaunching_(self, notification):
mask = NSKeyDownMask
NSEvent.addGlobalMonitorForEventsMatchingMask_handler_(mask, handler)
示例5: start_key_listener
# 需要导入模块: from Cocoa import NSEvent [as 别名]
# 或者: from Cocoa.NSEvent import addGlobalMonitorForEventsMatchingMask_handler_ [as 别名]
def start_key_listener(self):
#TODO may only need the keydown mask, rather than all three
mask = (NSKeyDownMask | NSKeyUpMask | NSFlagsChangedMask)
NSEvent.addGlobalMonitorForEventsMatchingMask_handler_(mask, self.key_handler)
示例6: applicationDidFinishLaunching_
# 需要导入模块: from Cocoa import NSEvent [as 别名]
# 或者: from Cocoa.NSEvent import addGlobalMonitorForEventsMatchingMask_handler_ [as 别名]
def applicationDidFinishLaunching_(self, notification):
mask1 = NSKeyDownMask
mask2 = NSLeftMouseUpMask
NSEvent.addGlobalMonitorForEventsMatchingMask_handler_(mask1, handler)
NSEvent.addGlobalMonitorForEventsMatchingMask_handler_(mask2, handler)
示例7: setupKeyCounterMac
# 需要导入模块: from Cocoa import NSEvent [as 别名]
# 或者: from Cocoa.NSEvent import addGlobalMonitorForEventsMatchingMask_handler_ [as 别名]
def setupKeyCounterMac(self):
mask = NSKeyDownMask
NSEvent.addGlobalMonitorForEventsMatchingMask_handler_(mask, self.macCountKey)
NSEvent.addLocalMonitorForEventsMatchingMask_handler_(mask, self.macCountKey)
示例8: start_click_listener
# 需要导入模块: from Cocoa import NSEvent [as 别名]
# 或者: from Cocoa.NSEvent import addGlobalMonitorForEventsMatchingMask_handler_ [as 别名]
def start_click_listener(self):
mask = (NSLeftMouseDownMask
| NSRightMouseDownMask) # | NSLeftMouseUpMask | NSRightMouseUpMask)
NSEvent.addGlobalMonitorForEventsMatchingMask_handler_(mask, self.click_handler)
示例9: start_scroll_listener
# 需要导入模块: from Cocoa import NSEvent [as 别名]
# 或者: from Cocoa.NSEvent import addGlobalMonitorForEventsMatchingMask_handler_ [as 别名]
def start_scroll_listener(self):
mask = (NSScrollWheelMask)
NSEvent.addGlobalMonitorForEventsMatchingMask_handler_(mask, self.scroll_handler)
示例10: applicationDidFinishLaunching_
# 需要导入模块: from Cocoa import NSEvent [as 别名]
# 或者: from Cocoa.NSEvent import addGlobalMonitorForEventsMatchingMask_handler_ [as 别名]
def applicationDidFinishLaunching_(self, notification):
mask = (NSKeyUpMask | NSFlagsChangedMask)
NSEvent.addGlobalMonitorForEventsMatchingMask_handler_(
mask, sc.handle_keyevent
)
sc.log('Event match mask and hander set')
示例11: applicationDidFinishLaunching_
# 需要导入模块: from Cocoa import NSEvent [as 别名]
# 或者: from Cocoa.NSEvent import addGlobalMonitorForEventsMatchingMask_handler_ [as 别名]
def applicationDidFinishLaunching_(self, notification):
downMask = NSKeyDownMask
upMask = NSKeyUpMask
NSEvent.addGlobalMonitorForEventsMatchingMask_handler_(downMask, downHandler)
NSEvent.addGlobalMonitorForEventsMatchingMask_handler_(upMask, upHandler)
示例12: start_move_listener
# 需要导入模块: from Cocoa import NSEvent [as 别名]
# 或者: from Cocoa.NSEvent import addGlobalMonitorForEventsMatchingMask_handler_ [as 别名]
def start_move_listener(self):
mask = (NSMouseMovedMask)
NSEvent.addGlobalMonitorForEventsMatchingMask_handler_(mask, self.move_handler)