Permalink
Browse files

Interaction: Ignore MSPointer events if they're initiated from a mous…

…e, but not from the primary button.
  • Loading branch information...
1 parent d6c3360 commit 3077b608c8e0049eebed9c4de1f7754e03e0f621 @scottgonzalez scottgonzalez committed Jan 13, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 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

0 comments on commit 3077b60

Please sign in to comment.