title: How to get LOCALIZED character on keypress?
body: <p>I need to get <strong>localized character</strong> on <code>keypress</code> event. For example: on a Czech keyboard I need to get ř not 5 character (key code 53) (see <a href="http://en.wikipedia.org/wiki/File:Keyboard_layout_Czech.svg" rel="nofollow noreferrer">Czech keyboard layout</a>). Is there any other way to get character and to not use text input and reading value? By other words is there any way how to get character from event object respecting current user keyboard layout?</p>
  
  <hr>
  
  <p>(Added sample code)</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;script language="JavaScript"&gt;
  function onLoad() {
      console.log(document.getElementById("test"));
      document.getElementById("test").onkeydown = function(event) {
                  console.log("Code: "+event.keyCode+"; Key: "+String.fromCharCode(event.keyCode));
          }
  }
  &lt;/script&gt;
  &lt;body onLoad="onLoad();"&gt;
      &lt;input id="test"&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>(Example <a href="http://projekty.mujserver.net/stackoverflow/questions-5420005-js-how-to-get-localized-character-on-keypress/example.html" rel="nofollow noreferrer">online</a>)</p>
  
  <p>When you try this code, and you press <kbd>ř</kbd>-key  you will see in Firebug console "Code: 53; Key: 5". And I need to get "ř" not "5".</p>
  
  <p>I think that this "problem" appears on all non-English keyboards.</p>