title: Creating a basic auto clicker in python
body: <p>I want to create a pretty simple automatic-clicker that  will take the position of your mouse, and clicks in that position as long as "active" is true and at "input" 's speed (clicks per second)</p>
  
  <p>I have seen this code floating around, but it does not suit my needs</p>
  
  <pre><code>import win32api, win32con
  def click(x,y):
      win32api.SetCursorPos((x,y))
      win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,x,y,0,0)
      win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,x,y,0,0)
  click(10,10)
  </code></pre>
  
  <p>I would like the code to look something like this, </p>
  
  <pre><code>import library 
  
  input = 5 ## in clicks per second
  
  if (some key) is held:
      active = True
  
  if (some key) is released:
      active = False
  
  
  while active:
       *gets position of mouse*
       *clicks at that position at input's speed (5)
  </code></pre>
  
  <p>It would also be nice if there was an option to click in the very center of the screen.</p>