Jump to content

F1 F2 F3 etc


pacome

Recommended Posts

javascript would be the only way. so if javascript can't do it - then you're out of luck. many of the function keys are hard programmed into the browser (eg, F3 for search, F5 for refresh) - so even if it was possible, many people (myself included) wouldn't be a fan of anything that removed "the norm" behaviour.

 

try access keys instead, with the accesskeys using the regular numbers.

 

eg

<a href="home.php" accesskey="1">Home page</a>

Link to comment
Share on other sites

you see, it's for a small game I'm programming for myself and some colleagues from work, so changing the normal use of the F keys will be acceptable...

 

if anyone is interested (though I know it's not php) I found this while surfing:

 

<SCRIPT language="JavaScript">

function keyTest()

{

var key=window.event.keyCode;//key code.

switch(key)

{

case 112: window.location="www.google.es"; break;

case 113: window.location="www.yahoo.com"; break;

case 114: window.location="www.gmail.com"; break;

//etc, etc...

}

return false;

}

</SCRIPT>

 

<body OnKeyDown="JavaScript:keyTest();" >

 

I think it just does the job...

thanks again for your help in directing me to JavaScript!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.