コード例 #1
0
ファイル: app.py プロジェクト: 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
コード例 #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
コード例 #3
0
ファイル: app.py プロジェクト: JohnChu/libavg
    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
コード例 #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