MCPcopy
hub / github.com/yosinski/deep-visualization-toolbox / handle_key_pre_apps

Method handle_key_pre_apps

live_vis.py:272–299  ·  view source on GitHub ↗
(self, key)

Source from the content-addressed store, hash-verified

270 print 'Input thread joined and apps quit; exiting run_loop.'
271
272 def handle_key_pre_apps(self, key):
273 tag = self.bindings.get_tag(key)
274 if tag == 'freeze_cam':
275 self.input_updater.freeze_cam = not self.input_updater.freeze_cam
276 elif tag == 'toggle_input_mode':
277 self.input_updater.toggle_input_mode()
278 elif tag == 'static_file_increment':
279 if self.input_updater.static_file_mode:
280 self.input_updater.increment_static_file_idx(1)
281 else:
282 self.input_updater.static_file_mode = True
283 elif tag == 'static_file_decrement':
284 if self.input_updater.static_file_mode:
285 self.input_updater.increment_static_file_idx(-1)
286 else:
287 self.input_updater.static_file_mode = True
288 elif tag == 'help_mode':
289 self.help_mode = not self.help_mode
290 elif tag == 'stretch_mode':
291 self.input_updater.toggle_stretch_mode()
292 print 'Stretch mode is now', self.input_updater.static_file_stretch_mode
293 elif tag == 'debug_level':
294 self.debug_level = (self.debug_level + 1) % 3
295 for app_name, app in self.apps.iteritems():
296 app.set_debug(self.debug_level)
297 else:
298 return key, False
299 return None, True
300
301 def handle_key_post_apps(self, key):
302 tag = self.bindings.get_tag(key)

Callers 1

run_loopMethod · 0.95

Calls 5

get_tagMethod · 0.80
toggle_input_modeMethod · 0.80
toggle_stretch_modeMethod · 0.80
set_debugMethod · 0.45

Tested by

no test coverage detected