title: Pygame: allow clicks to go through the window
body: <p>I'm making a pseudo transparent window in pygame with the intent of displaying varied info like a "HUD"</p>
  
  <p>The script uses PIL to grab an image of the desktop and use it as the background of the window.</p>
  
  <p>A simple version:</p>
  
  <pre><code>import pygame as py
  from ctypes import windll
  import ImageGrab, Image
  
  SetWindowPos = windll.user32.SetWindowPos
  
  py.init()
  
  def get_image():
      im = ImageGrab.grab((0,0,window_x,window_y))
      mode = im.mode
      size = im.size
      data = im.tobytes()
      im = py.image.fromstring(data,size,mode)
      return im
  
  window_x = 1920
  window_y = 100
  
  background = py.Surface((window_x,window_y))
  background.blit(get_image(),(0,0))
  
  window_pos = (0,0)
  
  
  screen = py.display.set_mode((window_x,window_y),py.HWSURFACE|py.NOFRAME)
  
  SetWindowPos(py.display.get_wm_info()['window'],-1,0,0,0,0,0x0001)
  
  clock = py.time.Clock()
  
  done = False
  
  while not done:
      for event in py.event.get():
          if event.type == py.QUIT:
              done = True
      screen.blit(background,(0,0))
      py.display.flip()
      clock.tick(30)
  
  py.quit()
  </code></pre>
  
  <p>This creates a Pygame window at the top of the screen.</p>
  
  <p>My problem is that the Pygame window blocks any mouse interaction with anything beneath it.</p>
  
  <p>Is there a way to allow mouse events to be ignored and go 'through' the window, like for example clicking on a desktop icon, underneath a Pygame window.</p>