View Full Version : how to add shift to this script

03-18-2004, 07:12 PM
I created a script to navigate using the f keys, but I need it to include shift + F1 here and I could only figure out how to do this using only the F1 key. Can anyone show me how to make this script to where the user has to use shift + F1:

function handleKeyPress(evt) {
var nbr, chr;
if (window.Event) nbr = evt.which;
else nbr = event.keyCode;
//Opens Link with Shift-F1
else{return true;}
document.onkeydown= handleKeyPress

Roy Sinclair
03-18-2004, 07:44 PM
That key is reserved for the help function and cannot be overriden by any web page.

03-18-2004, 08:06 PM
Okay, how could I do the same thing using shift + u? instead of F1

Roy Sinclair
03-18-2004, 08:48 PM
Look in the "Post a Javascript" forum here and you'll find a recently posted script which you can use to find the keycode of any key. With that you can set up your capture to watch for that particular keycode.

03-19-2004, 04:37 AM
The link "Key Events" in my sig leads to a page that might give you the idea on detecting modifier keys such as SHIFT, ALT and CTRL.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum