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
https://forums.phpfreaks.com/topic/50947-f1-f2-f3-etc/#findComment-250754
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
https://forums.phpfreaks.com/topic/50947-f1-f2-f3-etc/#findComment-250772
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.