- Timestamp:
- 06/06/06 18:49:28 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/StreamVision/StreamVision.py
r234 r235 119 119 self.hotKeys.append(hotKeyRef) 120 120 self.hotKeyActions[HotKey.HotKeyAddress(hotKeyRef)] = func 121 return hotKeyRef 122 123 def unregisterHotKey(self, hotKeyRef): 124 self.hotKeys.remove(hotKeyRef) 125 del self.hotKeyActions[HotKey.HotKeyAddress(hotKeyRef)] 126 hotKeyRef.UnregisterEventHotKey() 121 127 122 128 def incrementRatingBy(self, increment): … … 145 151 else: 146 152 XTensionApp().turnoff('Stereo') 147 153 154 def registerZoomWindowHotKey(self): 155 self.zoomWindowHotKey = self.registerHotKey(self.zoomWindow, 42, cmdKey | controlKey) # cmd-ctrl-\ 156 157 def unregisterZoomWindowHotKey(self): 158 self.unregisterHotKey(self.zoomWindowHotKey) 159 self.zoomWindowHotKey = None 160 148 161 def zoomWindow(self): 149 162 systemEvents = app(id='com.apple.systemEvents') … … 153 166 menu_bar_items['Window'].menus.menu_items['Zoom'].click() 154 167 return 168 elif frontName in ('X11', 'Emacs'): # preserve C-M-\ 169 self.unregisterZoomWindowHotKey() 170 systemEvents.key_code(42, using=[k.command_down, k.control_down]) 171 self.registerZoomWindowHotKey() 172 return 155 173 try: 156 174 zoomed = app(frontName).windows[1].zoomed 157 175 zoomed.set(not zoomed()) 158 except CommandError:176 except (CommandError, RuntimeError): 159 177 systemEvents.processes[frontName].windows. \ 160 178 filter(its.subrole == 'AXStandardWindow').windows[1]. \ … … 170 188 self.registerHotKey(lambda: self.incrementRatingBy(-20), 109, shiftKey) # shift-F10 171 189 self.registerHotKey(lambda: self.incrementRatingBy(20), 103, shiftKey) # shift-F11 172 self.register HotKey(self.zoomWindow, 42, cmdKey | controlKey) # cmd-ctrl-\190 self.registerZoomWindowHotKey() 173 191 NSDistributedNotificationCenter.defaultCenter().addObserver_selector_name_object_(self, self.displayTrackInfo, 'com.apple.iTunes.playerInfo', None) 174 192
Note:
See TracChangeset
for help on using the changeset viewer.