如何在离子应用中检测多指触摸

var*_*uru 16 angularjs cordova hybrid-mobile-app cordova-plugins ionic

我正在开发一个Ionic app.In我想要应用1个手指轻扫和2个手指轻扫和3个手指轻扫(如果可能).在div中如果用户用单指滑动,它应该滚动并且如果用户用多指滑动,则应选择内容并选择,应显示复制选项并用3个手指滑动以进行一次操作.

编辑:我在发布此问题之前检查了问题.我能够检测到多点触摸,但不能检测到2finger/3手指轻扫.我正在寻找这个动作的任何插件.

在这个问题上帮助我.

das*_*rge 3

看看Phonegap 开发者应用程序中如何实现 4 点触摸重新加载:

var currentTouches = {},
    eventName = { touchstart: 'touchstart', touchend: 'touchend' };

if (window.navigator.msPointerEnabled) {
    eventName = { touchstart: 'MSPointerDown', touchend: 'MSPointerUp' };
}

document.addEventListener(eventName.touchstart, function(evt) {
    var touches = evt.touches || [evt],
        touch;
    for(var i = 0, l = touches.length; i < l; i++) {
        touch = touches[i];
        currentTouches[touch.identifier || touch.pointerId] = touch;
    }
});

document.addEventListener(eventName.touchend, function(evt) {
    var touchCount = Object.keys(currentTouches).length;
    currentTouches = {};
    if (touchCount === 4) {
        evt.preventDefault();
        window.location.reload(true);
    }
}, false);
Run Code Online (Sandbox Code Playgroud)

希望这可以帮助。