Merge all changes from the naturaldocs sandbox. This brings all the work that
has been done in the NaturalDocs branch back to trunk. Thanks to everyone who helped out in making this happen. (I could list people, but the list would be long, and I'm already mentally on vacation.) git-svn-id: http://svn.openlayers.org/trunk/openlayers@3545 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -3,12 +3,13 @@
|
||||
* for the full text of the license. */
|
||||
|
||||
/**
|
||||
* Handler for dragging a rectangle across the map. Keyboard is displayed
|
||||
* on mouse down, moves on mouse move, and is finished on mouse up.
|
||||
*
|
||||
* @class
|
||||
* @requires OpenLayers/Handler.js
|
||||
* @requires OpenLayers/Events.js
|
||||
*
|
||||
* Class: OpenLayers.handler.Keyboard
|
||||
*
|
||||
* Inherits from:
|
||||
* - <OpenLayers.Handler>
|
||||
*/
|
||||
OpenLayers.Handler.Keyboard = OpenLayers.Class.create();
|
||||
OpenLayers.Handler.Keyboard.prototype = OpenLayers.Class.inherit( OpenLayers.Handler, {
|
||||
@@ -18,14 +19,21 @@ OpenLayers.Handler.Keyboard.prototype = OpenLayers.Class.inherit( OpenLayers.Han
|
||||
|
||||
/* supported named callbacks are: keyup, keydown, keypress */
|
||||
|
||||
/** constant */
|
||||
/**
|
||||
* Constant: KEY_EVENTS
|
||||
* keydown, keypress, keyup
|
||||
*/
|
||||
KEY_EVENTS: ["keydown", "keypress", "keyup"],
|
||||
|
||||
/** @type Function
|
||||
* @private
|
||||
/**
|
||||
* Property: eventListener
|
||||
* *Private*. {Function}
|
||||
*/
|
||||
eventListener: null,
|
||||
|
||||
/**
|
||||
* Constructor: OpenLayers.Handler.Keyboard
|
||||
*/
|
||||
initialize: function () {
|
||||
OpenLayers.Handler.prototype.initialize.apply(this, arguments);
|
||||
// cache the bound event listener method so it can be unobserved later
|
||||
@@ -33,7 +41,7 @@ OpenLayers.Handler.Keyboard.prototype = OpenLayers.Class.inherit( OpenLayers.Han
|
||||
},
|
||||
|
||||
/**
|
||||
*
|
||||
* Method: destroy
|
||||
*/
|
||||
destroy: function() {
|
||||
this.deactivate();
|
||||
@@ -41,6 +49,9 @@ OpenLayers.Handler.Keyboard.prototype = OpenLayers.Class.inherit( OpenLayers.Han
|
||||
OpenLayers.Control.prototype.destroy.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: activate
|
||||
*/
|
||||
activate: function() {
|
||||
if (OpenLayers.Handler.prototype.activate.apply(this, arguments)) {
|
||||
for (var i = 0; i < this.KEY_EVENTS.length; i++) {
|
||||
@@ -53,6 +64,9 @@ OpenLayers.Handler.Keyboard.prototype = OpenLayers.Class.inherit( OpenLayers.Han
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: deactivate
|
||||
*/
|
||||
deactivate: function() {
|
||||
if (OpenLayers.Handler.prototype.deactivate.apply(this, arguments)) {
|
||||
for (var i = 0; i < this.KEY_EVENTS.length; i++) {
|
||||
@@ -65,6 +79,9 @@ OpenLayers.Handler.Keyboard.prototype = OpenLayers.Class.inherit( OpenLayers.Han
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Method: handleKeyEvent
|
||||
*/
|
||||
handleKeyEvent: function (evt) {
|
||||
if (this.checkModifiers(evt)) {
|
||||
this.callback(evt.type, [evt.charCode || evt.keyCode]);
|
||||
|
||||
Reference in New Issue
Block a user