Interaction: Ignore MSPointer events if they're initiated from a mouse, but not from the primary button.

This commit is contained in:
Scott González 2012-01-12 21:25:19 -05:00
parent d6c3360dec
commit 3077b608c8

View File

@ -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 = { var pointerHook = interaction.hooks.msPointer = {
setup: function( widget, start ) { setup: function( widget, start ) {
widget._bind({ widget._bind({
@ -172,6 +170,14 @@ var pointerHook = interaction.hooks.msPointer = {
return; 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 // track which pointer is performing the interaction
pointerHook.id = event.pointerId; pointerHook.id = event.pointerId;
// prevent panning/zooming // prevent panning/zooming