Skip to content

Commit

Permalink
Interaction: Ignore MSPointer events if they're initiated from a mous…
Browse files Browse the repository at this point in the history
…e, but not from the primary button.
  • Loading branch information
scottgonzalez committed Jan 13, 2012
1 parent d6c3360 commit 3077b60
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ui/jquery.ui.interaction.js
Expand Up @@ -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({
Expand All @@ -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
Expand Down

0 comments on commit 3077b60

Please sign in to comment.