Hi All,
I am trying to simulate a application made in ASP.Net. which uses F1 F2 F3, F4, F5, F6, F7 keys to move the focus on different fields, however, I could stop the default functions attached with these keys in IE using some JS code, Below is the code i am using to disable keys from perfoming default action in IE.
but when I insert swf file in to the body and focus the Swf object the JS code dosenot work. can any one help.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
html, body { height:100%; background-color: #ffffff;}
body { margin:0; padding:0; overflow:hidden; }
#flashContent { width:100%; height:100%; }
</style>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script type="text/javascript">
$(window.document).keydown(function(event) {
if(event.which === 113){
window.event.cancelBubble = true;
window.event.returnValue= false;
//alert("113")
event.keyCode=0;
}
if(event.which === 114){
window.event.cancelBubble = true;
window.event.returnValue= false;
//alert("114")
event.keyCode=0;
}
if(event.which == 115){
window.event.cancelBubble = true;
window.event.returnValue= false;
//alert("115")
event.keyCode=0;
}
if(event.which == 116){
window.event.cancelBubble = true;
window.event.returnValue= false;
//alert("116")
event.keyCode=0;
}
if(event.which == 117){
window.event.cancelBubble = true;
window.event.returnValue= false;
//alert("117")
event.keyCode=0;
}
if(event.which == 118){
window.event.cancelBubble = true;
window.event.returnValue= false;
//alert("118")
event.keyCode=0;
}
})
function openHelp(){
}
</script>
</head>
<body onHelp="openHelp();return false">
<p>test code</p>
</body>
</html>