[OpenLayers-Users] Handler.Keyboard in IE?
pedrosimonetti at gmail.com
Wed Apr 9 23:57:43 EDT 2008
I'm doing some investigation about the OL's KeyboardDefaults Control. I've
notice that this control isn't working in both IE and Opera, as it was
stated here in this thread and in another one:
I've checked the tickets for this issue:
There, someone suggest altering the "window" to "document", in two places in
the "KeyboardDefaults.js" file. And there was a comment suggesting to change
the event handled to "onkeypress" to "onkeydown", considering the problems
with "onkeypress" events in IE, as PPK demonstrates at:
I've tested changing from "window" to "document", as the ticket suggets. And
I've changed also the "onkeypress" event to "onkeydown" in
This makes IE and Opera catch the keyboard events, but there's another
problem. It seems IE catch the "onkeydown" event twice with the "+" and "-"
keys used to zoom (I'm using IE6). And there's another problem with Opera.
In Opera, the "+" and "-" keys are used to increase the zoom of the page (it
changes both font and image sizes). So, pressing the "+" and "-" keys to
zoom in a map will also zoom the intire document.
I've noted that changing the event to "onkeyup" seems to fix the problem in
IE. But the Opera still has the problem with the "+" and "-" keys. I think
the solution will be canceling the event propagation. Does the OL has any
function to cancel event propagations? I don't know if Prototype has this
There's a cross-browser solution from Dean Edwards:
Anyway, I'm seding the patch for the modification of
"Control/KeyboardDefaults.js" and "Handler/Keyboard.js" if there's anyone
interested in investigate this issue. The patch were created over 2.6-RC2's
Christopher Schmidt-4 wrote:
> On Fri, Nov 09, 2007 at 04:11:45PM -0600, Jeff Dege wrote:
>> I'm taking a first look at Control.ModifyFeature, in 2.5, and the delete
>> key doesn't work in IE.
>> Works fine in Firefox, but in both IE6 and IE7,
>> ModifyFeature.handleKeypress() is never called at all. On exploring a
>> bit, it seems that Handler.Keyboard.handleKeyEvent() is never being
>> I'm running examples/modify-feature.html, as-is, except for some alert()
>> calls stuck in various places.
>> I can see no mention in the source that this functionality doesn't work
>> in IE. Has it simply not yet been implemented in IE? Or is it working
>> for everybody else, and it's just me?
> Christopher Schmidt
> Users mailing list
> Users at openlayers.org
View this message in context: http://www.nabble.com/Handler.Keyboard-in-IE--tp13676099p16601627.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users