Example #1
0
File: app.py Project: 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
Example #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
Example #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
Example #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
Example #5
0
 def onHide(self):
     if self.intervalID:
         libavg.player.clearInterval(self.intervalID)
         self.intervalID = None
     kbmgr.unbindKeyDown(keystring='i', modifiers=libavg.KEYMOD_CTRL)
Example #6
0
 def onHide(self):
     if self.intervalID:
         libavg.player.clearInterval(self.intervalID)
         self.intervalID = None
     kbmgr.unbindKeyDown(keyname='I', modifiers=libavg.KEYMOD_CTRL)