Skip to content

Commit

Permalink
Merge pull request openlayers#601 from temporaryaccount/temporaryopen…
Browse files Browse the repository at this point in the history
…layers

Prevent KeyboardDefaults.js from triggering keyboard events when user is...
  • Loading branch information
sbrunner committed Jul 20, 2012
2 parents 7249510 + 950904f commit 584749b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/OpenLayers/Control/KeyboardDefaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ OpenLayers.Control.KeyboardDefaults = OpenLayers.Class(OpenLayers.Control, {
*/
defaultKeyPress: function (evt) {
var size, handled = true;

if((typeof evt.target) != 'undefined' &&
(evt.target.tagName == 'INPUT' ||
evt.target.tagName == 'TEXTAREA' ||
evt.target.tagName == 'SELECT')) {
return;
}

switch(evt.keyCode) {
case OpenLayers.Event.KEY_LEFT:
this.map.pan(-this.slideFactor, 0);
Expand Down

0 comments on commit 584749b

Please sign in to comment.