Ejemplo n.º 1
0
Archivo: app.py Proyecto: libavg/libavg
    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
Ejemplo n.º 2
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
Ejemplo n.º 3
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
Ejemplo n.º 4
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