Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a web page with a map and search field. Something like Derek's "beer's finder" When I type a search request I somethimes use arrows to fix something. But if mouse is over the map, then I can't use arrows for text editing because map catches them. I tried to fix it the following way (without result):

    dojo.connect(this._currentmap, "onKeyDown", function(ev) {
        if (ev.keyCode >= 37 && ev.keyCode <= 40) { //if arrrow
            dojo.stopEvent(ev);
        }
    });

Do you know how I can fix this problem?

share|improve this question
    
please check out the dojo.keys namespace and convert to using that for readability etc. dojotoolkit.org/reference-guide/dojo/keys.html –  Steve Aug 16 '11 at 0:19
add comment

1 Answer 1

up vote 5 down vote accepted

You could try calling map.disableKeyboardNavigation() when the search field gets focus, and enableKeyboardNavigation() on blur.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.