title: Lock mouse in window Pygame
body: <p>I want to make a FPS game in Pygame in windowed mode. </p>
  
  <p>I need to be able to move my camera around for 360 degrees and more without limitation and with the hidden cursor. </p>
  
  <p>I used Pygame's <code>set_visible</code> and <code>set_pos</code> but it doesn't prevent my mouse going out of the window and blocking on the screen borders.</p>
  
  <pre><code>import pygame
  pygame.init()
  game_display = pygame.display.set_mode((800,600))
  pygame.mouse.set_visible(False)
  
  exit = False
  
  while (not exit):
      pygame.mouse.set_pos = (400, 300)
      mouse_move = (0,0)
      for event in pygame.event.get():
          if event.type == pygame.QUIT:
              exit = True
          if event.type == pygame.MOUSEMOTION:
              mouse_move = event.rel 
      if mouse_move != (0,0):
          print(mouse_move)
  
  pygame.quit()
  </code></pre>