469,927 Members | 1,655 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

How to capture function key presses

guys,

i want to capture all the function key presses from F1 to F12. now i
want that when the user presses F1 from within the browser i should
display a alert window saying that they have pressed F1 instead of
displaying the browser help.

how can i implement this. thanks.

Oct 31 '06 #1
2 5499
pe******@gmail.com ha scritto:
i want to capture all the function key presses from F1 to F12. now i
want that when the user presses F1 from within the browser i should
display a alert window saying that they have pressed F1 instead of
displaying the browser help.
You can do this in IE only with a .hta file (groups.google.com). For F1
key you can use:

window.onhelp=function()
{
alert("help");
return false;
}

Regards.

--
Luke S.

--

questo articolo e` stato inviato via web dal servizio gratuito
http://www.newsland.it/news segnala gli abusi ad ab***@newsland.it
Nov 1 '06 #2
ASM
pe******@gmail.com a écrit :
i want to capture all the function key presses from F1 to F12. now i
want that when the user presses F1 from within the browser i should
display a alert window saying that they have pressed F1 instead of
displaying the browser help.
In which browser ?
On Windows, Mac, Linux ... ?

i.e : my Opera thinks I press F4 when Ctrl+4 are pressed :-(
i.e : on my Mac F9 to F16 are reserved for system
doubt you can catch them ?
i.e : on my Browser F1 is not for the Help
(not important it does nothing)
how can i implement this. thanks.
Implement what and why ? and for who ?

In my FF on my Mac =
F1 -keyCode = 112
F2 -keyCode = 113
....
F12 _keyCode = 123

http://perso.wanadoo.fr/stephane.mor...c/key_code.htm

--
ASM
Nov 1 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Me Mine | last post: by
2 posts views Thread by aimee | last post: by
2 posts views Thread by orekinbck | last post: by
2 posts views Thread by Don | last post: by
reply views Thread by j101 | last post: by
5 posts views Thread by sourav08 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.