title: How to hook IE keyboard event?
body: <p>I am trying to disable browser shortcuts while user tries to press some combination of keys on the swf file. Although I can achieve this in Firefox, below code does not function in IE 8. Below code is able to hook the keyboard events if focus is not on the swf file. However, what I need is hooking keyboard events when user operates on swf file.</p>
  
  <pre><code>function hookKeyboardEvents(e) {
  
      alert("hooked key");
      // get key code
      var key_code = (window.event) ? event.keyCode : e.which;
  
      // case :if it is IE event
      if (window.event)
      {
          if (!event.shiftKey &amp;&amp; !event.ctrlKey &amp;&amp; !event.altKey) {
              window.event.returnValue = null;
              event.keyCode=0;
          }       
      }
      // case: if it is firefox event
      else
          e.preventDefault();
  
      document[flashId].keyDown(key_code);
  }
  
  window.document.onkeydown = hookKeyboardEvents;
  </code></pre>
  
  <p>Above code never executes when focus is on swf file.</p>