title: Raspberry Pi Python GPIO button to mouse left click
body: <p>I have connected a button to the <code>GPIO</code> on my <code>raspberry Pi</code> and I have tested it; it works. I have used the following code:</p>
  
  <pre><code>import RPi.GPIO as GPIO
  
  GPIO.setmode(GPIO.BOARD)
  GPIO.setup(16,GPIO.IN)
  </code></pre>
  
  <p>finally:</p>
  
  <pre><code>GPIO.cleanup()
  </code></pre>
  
  <p>All I want is for that button to imitate a left mouse click. So that when it is pressed the <code>pi</code> thinks i have left clicked on the mouse.</p>
  
  <p>Any help would be appreciated.</p>