title: Python character to keyboard hex
body: <p>I would like to know how to change a keyboard key's character to it's hex value.
  For example:</p>
  
  <p>Key A: 0x41</p>
  
  <p>Key B: 0x42</p>
  
  <p>Key P: 0x80</p>
  
  <p>Key Z: 0x5A</p>
  
  <p><a href="http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=00000520.html" rel="nofollow">http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=00000520.html</a></p>
  
  <p>The link above also has a list of the base 10 numbers for each key code, but I need those base 10 numbers converted to hex. Is there any easy way to just do something like this?</p>
  
  <pre><code>&gt;&gt;&gt; toHex("b")
  0x42
  </code></pre>