Hi!

I have an application with three frames. I want to assign custom functions
to different combinations of keystrokes. For instance I want to display a
popup window if the user presses F1 (keycode 112).


I have placed this proc in "leftFrame - Nav.htm" and it only works for
"Nav.htm":

Sub KeyFunctions()
Select Case window.event.keyCode
Case 112
...

End Select
End Sub

<body onkeydown="KeyFunctions()">

I have two questions:


1. Where do I put the procedure so that it works across all frames
regardless which frame has focus?
2. How can I override the default behavior of IE showing the Help wizard
when pressing F1 or prevent IE from doing other things when pressing an
already built in key combination?

Regards
PO

Re: Assigning functions to keystrokes by Rafael

Rafael
Mon May 23 21:15:47 CDT 2005

PO,

You will have to put the code in the main page not on the frames.
As for disabling functionality of built in functions, try not to because one
you are doing it from an html page which will look like a virus or trojan,
and two because it will be confusing for users expecting to see their
regular help file.
try assigning another key.

RT

"PO" <po> wrote in message news:e6jdPH$XFHA.2128@TK2MSFTNGP15.phx.gbl...
> Hi!
>
> I have an application with three frames. I want to assign custom functions
> to different combinations of keystrokes. For instance I want to display a
> popup window if the user presses F1 (keycode 112).
>
>
> I have placed this proc in "leftFrame - Nav.htm" and it only works for
> "Nav.htm":
>
> Sub KeyFunctions()
> Select Case window.event.keyCode
> Case 112
> ...
>
> End Select
> End Sub
>
> <body onkeydown="KeyFunctions()">
>
> I have two questions:
>
>
> 1. Where do I put the procedure so that it works across all frames
> regardless which frame has focus?
> 2. How can I override the default behavior of IE showing the Help wizard
> when pressing F1 or prevent IE from doing other things when pressing an
> already built in key combination?
>
> Regards
> PO
>
>



Re: Assigning functions to keystrokes by Joe

Joe
Sat May 28 05:48:35 CDT 2005

In IE you can use onhelp to call a function when F1 is pressed. Return false to
prevent the standard help appearing as well:
<body onhelp="myHelpFunction();" ...

function myHelpFunction()
{
alert("Help is at hand.");
return false;
}


--

Joe (MVP)

https://mvp.support.microsoft.com/profile=8AA9D5F5-E1C2-44C7-BCE8-8741D22D17A5