JavaScript Forum

How to disable F8 key across windows


I have to disable F8 key, but it only applies to the particular page. And within the page, I had embeded a pdf file, the problem now is when I highlight on the pdf file within the page, the F8 is not disabled. It only applies outside the embeded pdf but within the page.



So, I was thinking is there a way to disable F8 across windows with code, I do not want to use any software.
Code:
  1. document.attachEvent("onkeydown", my_onkeydown_handler);
  2. function my_onkeydown_handler()
  3. {
  4.  switch (event.keyCode)
  5.  {
  6.   case 119 : // 'F5'
  7.   event.returnValue = false;
  8.   event.keyCode = 0;
  9.   window.status = "F8 is disabled";
  10.   break;
  11.  }
  12. }


No comments:

Post a Comment

Comment On Facebook