Add support in OL for right-click capturing, including dbl-right-clicks (for zooming out in navigation control). Thanks to David Martin for this nice patch and the great 8 foot austrian for his review (Closes #1359)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7872 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -104,6 +104,21 @@ OpenLayers.Event = {
|
||||
((event.button) && (event.button == 1)));
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: isRightClick
|
||||
* Determine whether event was caused by a right mouse click.
|
||||
*
|
||||
* Parameters:
|
||||
* event - {Event}
|
||||
*
|
||||
* Returns:
|
||||
* {Boolean}
|
||||
*/
|
||||
isRightClick: function(event) {
|
||||
return (((event.which) && (event.which == 3)) ||
|
||||
((event.button) && (event.button == 2)));
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: stop
|
||||
* Stops an event from propagating.
|
||||
@@ -352,7 +367,7 @@ OpenLayers.Events = OpenLayers.Class({
|
||||
BROWSER_EVENTS: [
|
||||
"mouseover", "mouseout",
|
||||
"mousedown", "mouseup", "mousemove",
|
||||
"click", "dblclick",
|
||||
"click", "dblclick", "rightclick", "dblrightclick",
|
||||
"resize", "focus", "blur"
|
||||
],
|
||||
|
||||
|
||||
Reference in New Issue
Block a user