<span class="Apple-style-span" style="border-collapse: collapse; color: rgb(51, 51, 51); font-family: arial, sans-serif; font-size: 13px; ">Hi Sasha,<div><br></div><div>thanks for your reply.</div><div><br></div><div>Doesn&#39;t that interfere with OpenLayers.Control.KeyboardDefaults which I also use? I means, if you hijack the document handler, OL is probably unable to handle other events, isn&#39;t it?</div>
<div><br></div><div>Thanks!</div></span><br><div class="gmail_quote">2011/7/22 Sasha Milenkovic <span dir="ltr">&lt;<a href="mailto:sasha.milenkovic@gmail.com">sasha.milenkovic@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I am doing that on a classic JavaScript way:<div><br></div><div><div>document.onkeyup=function(e)</div><div>{</div><div>... ...</div><div>}</div><div><br></div><div>Best Regards!</div><br><div class="gmail_quote"><div><div>
</div><div class="h5">On Thu, Jul 21, 2011 at 11:19 PM, Jan Wedel <span dir="ltr">&lt;<a href="mailto:jan.wedel@googlemail.com" target="_blank">jan.wedel@googlemail.com</a>&gt;</span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class="h5">Nobody any idea how to react on keyboard events?<br>
<br>
Am 16.07.2011 um 23:03 schrieb Jan Wedel:<br>
</div></div><div><div></div><div><div><div></div><div class="h5"><br>
&gt; Hi!<br>
&gt;<br>
&gt; I&#39;m trying to get the keyboard handler to work. I want to catch the keypress event, especially for the space key and hide/display the overlay layer of my map.<br>
&gt;<br>
&gt; 1.) How can I set up the handler to react on keypressed events? In the APi, it says the callbacks object should contain exactly one function that takes the position of the mouse pointer which is not what I want.<br>


&gt; 2.) On my callback function, how can I find out what key was actually pressed?<br>
&gt; 3.) How can I &quot;install&quot; this handler? There is no addHandler method in OpenLayers.Map class...<br>
&gt;<br>
&gt; I tried to find some information in the API documentation but it doesn&#39;t answer my question!<br>
&gt;<br>
&gt; Thanks a lot!<br>
&gt;<br>
&gt; //Jan<br>
<br></div></div>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org" target="_blank">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Macte animo!<br>
</div>
</blockquote></div><br>