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:
euzuro
2008-08-26 23:27:04 +00:00
parent 091d3cfbeb
commit 17160f49e0
4 changed files with 132 additions and 11 deletions
+16 -1
View File
@@ -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"
],