onKeyDown -> disable browser actions

Hello,<br />
<br />
Is it possible to disable or avoid the default browser action when pressing on a key, using the onKeyDown?<br />
<br />
i.e. if I try this...<br />
<br />
switch(window.event.keyCode)<br />
{<br />
case 114: // Functionkey F3 <br />
foo()<br />
break;<br />
}<br />
<br />
If I press the F3-key, the function will be executed, but also the default action of my IE6.0 (search) will be triggered. Is it possible to avoid this?<br />
<br />
K.R.<br />
<br />
Luc<!--content-->Looking at the documentation at <!-- m --><a class="postlink" href="http://msdn.microsoft.com/workshop/author/dhtml/reference/events/onkeydown.asp">http://msdn.microsoft.com/workshop/auth ... eydown.asp</a><!-- m --> it would appear that you cannot cancel the default action of any F key, unless you are an HTA.<!--content-->Originally posted by luc <br />
If I press the F3-key, the function will be executed, but also the default action of my IE6.0 (search) will be triggered. Is it possible to avoid this?I don't think so. You are always better off choosing keys that don't have default values, if possible.<!--content-->
 
Back
Top