当前位置: 首页>>代码示例>>Python>>正文


Python NSEvent.addGlobalMonitorForEventsMatchingMask_handler_方法代码示例

本文整理汇总了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)
开发者ID:jonasrk,项目名称:selfspy,代码行数:34,代码来源:sniff_cocoa.py

示例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)
开发者ID:iandennismiller,项目名称:selfspy,代码行数:11,代码来源:sniff_cocoa.py

示例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)
开发者ID:jcla1,项目名称:quantified_self,代码行数:12,代码来源:sniff_cocoa.py

示例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)
开发者ID:BraedenYoung,项目名称:ProductivityTracker,代码行数:5,代码来源:keylogger.py

示例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)
开发者ID:SalahELGO,项目名称:traces,代码行数:6,代码来源:key_recorder.py

示例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)
开发者ID:85matthew,项目名称:keystroke,代码行数:7,代码来源:keystroke.py

示例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)
开发者ID:omad,项目名称:KeyCounter,代码行数:6,代码来源:gui.py

示例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)
开发者ID:SalahELGO,项目名称:traces,代码行数:7,代码来源:click_recorder.py

示例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)
开发者ID:SalahELGO,项目名称:traces,代码行数:5,代码来源:scroll_recorder.py

示例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')
开发者ID:mynicolas,项目名称:KeyCounter,代码行数:8,代码来源:macos_counter.py

示例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)
开发者ID:zeroerrequattro,项目名称:softmech,代码行数:7,代码来源:softmech-OSX.py

示例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)
开发者ID:SalahELGO,项目名称:traces,代码行数:5,代码来源:move_recorder.py


注:本文中的Cocoa.NSEvent.addGlobalMonitorForEventsMatchingMask_handler_方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。