def _setupKeyboardManager(self): keyboardmanager.init() keyboardmanager.bindKeyDown(keyname='D', handler=self._debugPanel.toggleVisibility, help='Show/hide the debug panel', modifiers=libavg.avg.KEYMOD_CTRL) keyboardmanager.bindKeyDown(keyname='H', handler=lambda: libavg.player.showCursor( not libavg.player.isCursorShown()), help='Show/hide cursor', modifiers=libavg.avg.KEYMOD_CTRL) keyboardmanager.bindKeyDown(keyname='P', handler=self.takeScreenshot, help='Take screenshot', modifiers=libavg.avg.KEYMOD_CTRL) keyboardmanager.bindKeyDown(keyname='B', handler=self.dumpTextObjectCount, help='Dump objects count to the console', modifiers=libavg.avg.KEYMOD_CTRL) keyboardmanager.bindKeyDown(keyname='E', handler=self._toggleMtEmulation, help='Toggle multitouch emulation', modifiers=libavg.avg.KEYMOD_CTRL) self.debugPanel.setupKeys()
def _setupKeyboardManager(self): keyboardmanager.init() keyboardmanager.bindKeyDown( keyname='D', handler=self._debugPanel.toggleVisibility, help='Show/hide the debug panel', modifiers=libavg.avg.KEYMOD_CTRL) keyboardmanager.bindKeyDown( keyname='H', handler=lambda: libavg.player.showCursor( not libavg.player.isCursorShown()), help='Show/hide cursor', modifiers=libavg.avg.KEYMOD_CTRL) keyboardmanager.bindKeyDown( keyname='P', handler=self.takeScreenshot, help='Take screenshot', modifiers=libavg.avg.KEYMOD_CTRL) keyboardmanager.bindKeyDown( keyname='B', handler=self.dumpTextObjectCount, help='Dump objects count to the console', modifiers=libavg.avg.KEYMOD_CTRL) keyboardmanager.bindKeyDown( keyname='E', handler=self._toggleMtEmulation, help='Toggle multitouch emulation', modifiers=libavg.avg.KEYMOD_CTRL) self.debugPanel.setupKeys()
def _toggleMtEmulation(self): if self._mtEmu is None: self._mtEmu = mtemu.MTemu() keyboardmanager.bindKeyDown( keyname='Shift', handler=self._mtEmu.enableDualTouch, help='Enable pinch gesture emulation') keyboardmanager.bindKeyUp( keyname='Shift', handler=self._mtEmu.disableDualTouch, help='Disable pinch gesture emulation') keyboardmanager.bindKeyDown( keyname='T', handler=self._mtEmu.toggleSource, help='Toggle source between TOUCH and TRACK', modifiers=libavg.avg.KEYMOD_CTRL) else: self._mtEmu.deinit() keyboardmanager.unbindKeyDown( keyname='T', modifiers=libavg.avg.KEYMOD_CTRL) keyboardmanager.unbindKeyDown(keyname='Shift') keyboardmanager.unbindKeyUp(keyname='Shift') del self._mtEmu self._mtEmu = None
def onShow(self): self.intervalID = libavg.player.setInterval(1000, self.update) kbmgr.bindKeyDown( keyname='I', handler=self.persistColumn, help="Object count snapshot", modifiers=libavg.KEYMOD_CTRL)
def _toggleMtEmulation(self): if self._mtEmu is None: self._mtEmu = mtemu.MTemu() keyboardmanager.bindKeyDown( keyname='Shift', handler=self._mtEmu.enableDualTouch, help='Enable pinch gesture emulation') keyboardmanager.bindKeyUp( keyname='Shift', handler=self._mtEmu.disableDualTouch, help='Disable pinch gesture emulation') keyboardmanager.bindKeyDown( keyname='T', handler=self._mtEmu.toggleSource, help='Toggle source between TOUCH and TRACK', modifiers=libavg.avg.KEYMOD_CTRL) else: self._mtEmu.deinit() keyboardmanager.unbindKeyDown(keyname='t', modifiers=libavg.avg.KEYMOD_CTRL) keyboardmanager.unbindKeyDown(keyname='shift') keyboardmanager.unbindKeyUp(keyname='shift') del self._mtEmu self._mtEmu = None
def _toggleMtEmulation(self): if self._mtEmu is None: self._mtEmu = mtemu.MTemu() keyboardmanager.bindKeyDown('shift', self._mtEmu.enableDualTouch, 'Enable pinch gesture emulation') keyboardmanager.bindKeyUp('shift', self._mtEmu.disableDualTouch, 'Disable pinch gesture emulation') keyboardmanager.bindKeyDown('t', self._mtEmu.toggleSource, 'Toggle source between TOUCH and TRACK', libavg.avg.KEYMOD_CTRL) else: self._mtEmu.deinit() keyboardmanager.unbindKeyDown('t', libavg.avg.KEYMOD_CTRL) keyboardmanager.unbindKeyDown('shift') keyboardmanager.unbindKeyUp('shift') del self._mtEmu self._mtEmu = None
def _toggleMtEmulation(self): if self._mtEmu is None: self._mtEmu = mtemu.MTemu() keyboardmanager.bindKeyDown('shift', self._mtEmu.enableDualTouch, 'Enable pinch gesture emulation') keyboardmanager.bindKeyUp('shift', self._mtEmu.disableDualTouch, 'Disable pinch gesture emulation') keyboardmanager.bindKeyDown( 't', self._mtEmu.toggleSource, 'Toggle source between TOUCH and TRACK', libavg.avg.KEYMOD_CTRL) else: self._mtEmu.deinit() keyboardmanager.unbindKeyDown('t', libavg.avg.KEYMOD_CTRL) keyboardmanager.unbindKeyDown('shift') keyboardmanager.unbindKeyUp('shift') del self._mtEmu self._mtEmu = None
def setupKeys(self): kbmgr.bindKeyDown(keystring='g', handler=lambda: self.toggleWidget(GPUMemoryGraphWidget), help="GPU memory graph", modifiers=libavg.avg.KEYMOD_CTRL) kbmgr.bindKeyDown(keystring='m', handler=lambda: self.toggleWidget(MemoryGraphWidget), help="Memory graph", modifiers=libavg.avg.KEYMOD_CTRL) kbmgr.bindKeyDown(keystring='f', handler=lambda: self.toggleWidget(FrametimeGraphWidget), help="Frametime graph", modifiers=libavg.avg.KEYMOD_CTRL) kbmgr.bindKeyDown(keystring='?', handler=lambda: self.toggleWidget(KeyboardManagerBindingsShower), help="Show keyboard bindings", modifiers=kbmgr.KEYMOD_ANY) kbmgr.bindKeyDown(keystring='o', handler=lambda: self.toggleWidget(ObjectDumpWidget), help="Object count table", modifiers=libavg.avg.KEYMOD_CTRL) kbmgr.bindKeyDown(keystring='v', handler=self.toggleTouchVisualization, help="Cursor visualization", modifiers=libavg.avg.KEYMOD_CTRL)
def setupKeys(self): kbmgr.bindKeyDown( keyname='G', handler=lambda: self.toggleWidget(GPUMemoryGraphWidget), help="GPU memory graph", modifiers=libavg.avg.KEYMOD_CTRL) kbmgr.bindKeyDown(keyname='M', handler=lambda: self.toggleWidget(MemoryGraphWidget), help="Memory graph", modifiers=libavg.avg.KEYMOD_CTRL) kbmgr.bindKeyDown( keyname='F', handler=lambda: self.toggleWidget(FrametimeGraphWidget), help="Frametime graph", modifiers=libavg.avg.KEYMOD_CTRL) kbmgr.bindKeyDown( text='?', handler=lambda: self.toggleWidget(KeyboardManagerBindingsShower), help="Show keyboard bindings", modifiers=kbmgr.KEYMOD_ANY) kbmgr.bindKeyDown(keyname='O', handler=lambda: self.toggleWidget(ObjectDumpWidget), help="Object count table", modifiers=libavg.avg.KEYMOD_CTRL) kbmgr.bindKeyDown(keyname='V', handler=self.toggleTouchVisualization, help="Cursor visualization", modifiers=libavg.avg.KEYMOD_CTRL)