Exemple #1
0
    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()
Exemple #2
0
    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()
Exemple #3
0
    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
Exemple #4
0
 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)
Exemple #5
0
    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
Exemple #6
0
 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)
Exemple #7
0
    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
Exemple #8
0
    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
Exemple #9
0
    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)
Exemple #10
0
    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)