Example #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()
Example #2
0
File: app.py Project: libavg/libavg
    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()