Exemple #1
0
 def finishLaunching(self):
     super(HotKeyApp, self).finishLaunching()
     print hotkeys
     #print hasattr(Carbon.CarbonEvt, 'RegisterEventHotKey')
     if hotkeys:
         print 'registering hot keys!'
         # register cmd-control-J
         #self.hotKeyRef = RegisterEventHotKey(38, cmdKey | controlKey, (0, 0),
         # key ref http://snipplr.com/view/42797/
         # F7=0x62 F8=0x64 F9=0x65
         #self.hotKeyRef1 = RegisterEventHotKey(0x62, 0, (0, 0),
         #                                     GetApplicationEventTarget(), 0)
         self.hotKeyRef2 = RegisterEventHotKey(0x64, 0, (0, 0),
                                              GetApplicationEventTarget(), 0)
         #self.hotKeyRef3 = RegisterEventHotKey(0x65, 0, (0, 0),
         #                                     GetApplicationEventTarget(), 0)
     else:
         print 'could not register hot keys! not running in 32 bit mode?'
Exemple #2
0
 def finishLaunching(self):
     super(HotKeyApp, self).finishLaunching()
     # register cmd-control-J
     self.hotKeyRef = RegisterEventHotKey(38, cmdKey | controlKey, (0, 0),
                                          GetApplicationEventTarget(), 0)
Exemple #3
0
 def register_key(self, key, function):
     super(OSXKeyboardHandler, self).register_key(key, function)
     k, m = self.parse_key(key)
     key_id = RegisterEventHotKey(k, m, (0, 0), GetApplicationEventTarget(), 0)
     self.key_ids[key] = key_id