title: change KeyCode in javascript in google chrome
body: <p>i am using javascript to change KeyCode for automatic convert keybourd into persian keyboard.
  my code is shown in below</p>
  
  <pre><code>function submitenter(myfield, e) {
      var key;
      if(window.event)
          key = window.event.keyCode;
      else if(e)
          key = e.which;
      var str=' !"#$%،گ)(×+و-./0123456789:ك,=.؟@ِذ}يُيلآةـ،/’د×؛َءٍف‘{ًْإ~جژچ^_پشذزيثبلاهتنمئدخحضقسفعرصطغظ&lt;|&gt;ّ';
      if(key &gt; 31 &amp;&amp; key &lt; 128) {
          window.event.keyCode=str.charCodeAt(key-32);
          return true;
      }
      if(key==13 || key==8 || key==0)
          return true;
      return false;
  }
  
  &lt;input type=text name="Name" onkeypress="return submitenter(this, event);"&gt;
  </code></pre>
  
  <p>this code work in IE but in <strong>Firefox and google chrome</strong> not worked</p>