edoyuk
asked on
disabling F1,F2,F3....
Is it possible to disable F1,F2... with javascript?
For example, in my web page I wanna use F3 but I dont wanna the search screen appearing on the left?
Thanks...
For example, in my web page I wanna use F3 but I dont wanna the search screen appearing on the left?
Thanks...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
doesn't work!
Search screen places on the left after alerting " F3 key was pressed"
Search screen places on the left after alerting " F3 key was pressed"
ASKER
Sorry, it works!
Thanks a lot.
Thanks a lot.
Thanks this works great for HTML/JavaScript. Do you know if there's anyway to apply this to an embedded Flash object?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<script>
keys = new Array();
keys["f112"] = 'f1';
keys["f113"] = 'f2';
keys["f114"] = 'f3';
keys["f115"] = 'f4';
keys["f116"] = 'f5';
keys["f117"] = 'f6';
keys["f118"] = 'f7';
keys["f119"] = 'f8';
keys["f120"] = 'f9';
keys["f121"] = 'f10';
keys["f122"] = 'f11';
keys["f123"] = 'f12';
saveCode=""
function myFunc(code) {
alert('testing '+code)
}
document.onkeydown = function(){
// Capture and remap F-key
if(window.event && keys["f"+window.event.keyC
saveCode=window.event.keyC
window.event.keyCode = 505;
}
if(window.event && window.event.keyCode == 505) {
// New action for keycode
myFunc(saveCode)
return false; // Must return false or the browser will execute old code
}
}
</script>
</body>
</html>