Re: Disabling default behavior of function keys
From: Joe Fawcett (joefawcett_at_hotmail.com)
Date: 12/07/04
- Next message: SÁRINGER Zoltán: "simple frame question:make frameset if load the page from outside.."
- Previous message: Guido Kraus: "IE6: Disabling default behavior of function keys"
- In reply to: Guido Kraus: "IE6: Disabling default behavior of function keys"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 7 Dec 2004 15:43:36 -0000
"Guido Kraus" <guido@somewhere.com> wrote in message
news:BA59B196-2383-46B4-A7E9-8686F3365DE9@microsoft.com...
> Hi,
>
> I have to write a web application that has a similar interface like a
legacy
> app. The legacy app uses function keys (F1-F10) for some operations. I use
an
> onKeyDown event handler to trap these keys but unfortunately I don't know
how
> to disable the default behavior of the function keys. For example, IE6
opens
> help if you press F1, it opens its 'Search' pane if you press F3 and so
on.
>
> Is it possible to cancel the default behavior of the function keys?
>
> I tried the following script:
>
> <script LANGUAGE="javascript">
>
> document.onkeydown = function(){
>
> if(window.event && window.event.keyCode == 112) {
> // Capture F1
> event.KeyCode = 0;
> event.cancelBubble = true;
> event.returnValue = false;
> alert('F1 key was pressed');
> return false;
> }
>
> }
>
> Thanks for any ideas,
> Guido
Wll F1 is easy, override the onhelp event:
<body onhelp="return handleOnHelp();">
function handleOnHelp()
{
//On help code
return false;
}
For others although they are trappable they are not cancellable outside of
HTML applications.
-- Joe
- Next message: SÁRINGER Zoltán: "simple frame question:make frameset if load the page from outside.."
- Previous message: Guido Kraus: "IE6: Disabling default behavior of function keys"
- In reply to: Guido Kraus: "IE6: Disabling default behavior of function keys"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|