From 3077b608c8e0049eebed9c4de1f7754e03e0f621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 12 Jan 2012 21:25:19 -0500 Subject: [PATCH] Interaction: Ignore MSPointer events if they're initiated from a mouse, but not from the primary button. --- ui/jquery.ui.interaction.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ui/jquery.ui.interaction.js b/ui/jquery.ui.interaction.js index 35b1e7704..a88dfe341 100644 --- a/ui/jquery.ui.interaction.js +++ b/ui/jquery.ui.interaction.js @@ -160,8 +160,6 @@ var touchHook = interaction.hooks.touch = { } }; -// TODO: test mouse -// TODO: how can we detect a "right click" with a pen? var pointerHook = interaction.hooks.msPointer = { setup: function( widget, start ) { widget._bind({ @@ -172,6 +170,14 @@ var pointerHook = interaction.hooks.msPointer = { return; } + // TODO: how can we detect a "right click" with a pen? + // TODO: get full details about which and button from MS + // touch and pen = 1 + // primary mouse button = 2 + if ( event.which > 2 ) { + return; + } + // track which pointer is performing the interaction pointerHook.id = event.pointerId; // prevent panning/zooming