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
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