0 Replies Latest reply on Dec 28, 2006 11:32 AM by dzlmbq

    Disable IE Function Keys

    dzlmbq
      I am trying to disable the F1 through F12 keys for a Point of Sale applicaiton. I can capture keystrokes in Javascript and in Flex 2. However, I cannot disable the function keys when the Flex swf is in focus. Only before using Javascript in the HTML wrapper file like so:

      Text Is there a way to disable the standard function keys using Flex 2?

      <html>
      <head>
      <script type="text/javascript">
      document.onkeydown = function (evt)
      {
      var c = document.layers ? evt.which
      : document.all ? event.keyCode
      : evt.keyCode;
      if(document.onhelp == null) document.onhelp = function() { return false; }
      //alert('Pressed ' + String.fromCharCode(c) + '(' + c + ')');
      //This is a post back to the server
      //I can make the user control invisible eventually so the number doesn't apear
      switch( event.keyCode )
      { case 112:
      case 113:
      break;
      case 114:
      break;
      case 115:
      break;
      case 116:
      break;
      case 117:
      break;
      case 118:
      break;
      case 119:
      break;
      case 120:
      break;
      case 121:
      break;
      case 122:
      break;
      case 123:
      break;
      }

      event.keyCode = 0;
      event.returnValue = false;
      return false;
      }
      </script>
      </head>
      <body></body>
      </html>