title: Printing (writing) Sikuli key constants
body: <p>My Sikuli script logs all operations using Python module <em>logging</em>. Problems occur when I try to write into a log a key constant that was typed. As an example I used <em>print</em> function because it requires a string too:</p>
  
  <pre><code>print((Key.ALT).encode('utf-8'))#exception not thrown but nothing readable is printed
  print(Key.ALT)                  #UnicodeEncodeError: 'ascii' codec can't encode character u'\ue022' in position 0: ordinal not in range(128)
  </code></pre>
  
  <p>Of course I could compare a variable with all possible key contants:</p>
  
  <pre><code>myKey = Key.ALT
  if(myKey==Key.CTRL):
      print('ctrl pressed')
  elif(myKey==Key.ALT):
      print('alt pressed')
  #etc…
  </code></pre>
  
  <p>but this is not most efficient way I guess. I could also do some other workarounds like this: </p>
  
  <pre><code>print(“Key.ALT pressed”)
  keyDown(Key.ALT)
  </code></pre>
  
  <p>but I want to find a way to convert <em>Key.CONSTANT</em> into a printable (writable) format so that my "typing"
   function takes only 1 argument (only key constant to be used for typing and for logging). Is it possible?</p>