title: How to simulate a key press in Python on a linux machine
body: <p>How do you simulate a key press in python on a linux machine?</p>
  
  <p>This is for use with an emulator and making a bot which can play a game.</p>
  
  <p>So primarily the 'wasd' keys, space and so on, this thread <a href="https://stackoverflow.com/questions/14489013/simulate-python-keypresses-for-controlling-a-game">here</a> is more or less what I want, however I believe that this solution is windows specific using </p>
  
  <pre><code>ctypes.windll
  </code></pre>
  
  <p>I believe that the main problem and why this is hard to do is to do with 'ScanCodes' and 'VKs', games tend to ignore as this is not how the user interacts with the game</p>
  
  <p>So is there any linux workaround like the above for linux? 
  Any help is appreciated, thank you.</p>