title: Using java.awt.Robot in a multithreaded environment
body: <p>I'm working on a (virtual) competitive automated tetris player.</p>
  
  <p>Since the game is, well, competitive, I would naturally like my tetris player to press as many keys as possible at the same time. The solution I have come up with is to devote a thread to each kind of keypress (that way, if two of the same key gets sent, there is a delay, as they are on the same thread. But if two seperate keys get sent, their threads also execute separately, causing both keys to be pressed at the same time).</p>
  
  <p>But due to the multithreading, I am worried that java.awt.Robot is not Thread safe (and googles/SO searches result in no information on the subject). I'd like to avoid creating locks on the Robot object I am using -- If I do that, the entire system becomes pointless (as there would then not be multiple keypresses at the same time, each one would come right after the other).</p>
  
  <p>One possibility is maybe using multiple Robots at the same time (One for each thread), but I am not so sure that they would not simply conflict with each other.</p>
  
  <p>So, how can I deal with a Robot object in a multithreaded environment, so that multiple actions can be executed at the same time?</p>